Change char to varchar2 for all tables

Hello
I need to change the data type of char to varchar2 globally for all tables. For example, if four tables in a database contains one or more columns of type char (128), it should be replaced by varchar2 (128). I can do in a single statement?

Thank you
Sujnan

Hello

Try this...
Coil d:\column_type.sql

Select 'alter table' | table_name |' change '. column_name |' varchar2 (128);' from all_tab_columns where data_type = 'CHAR' and table_name =' or select from user_tables help subquery ' >;

Spool off

You will get sql statements to change the data type of Char to varchar2 (128)
Run the file on hold and you have completed the task.

Concerning

You can also do this by using the procedure. Use the cursor to select name tablename and column of the user_tab_columns or All_tab_columns and then use immediate Execute to execute the statement Alter table.

Published by: user644725 on October 22, 2008 12:16 AM

Tags: Database

Similar Questions

  • I keep getting these messages that do not allow to use a file. What should I change to have privileges for all functions?

    Original title: administrator Win7

    I have win7 and IE11 running on a HP 8540p.  I'm the only person authorized to use the laptop - I am the administrator.

    I keep getting these messages that do not allow to use a file.  What should I change to have privileges for all functions?

    The second file is not cooperating and was not deleted.

    "Not cooperating" can mean many different things. A real verbatim error message would be more useful. In the case of locked files, it is often possible to remove safe mode.

  • [ADF, JDev12.1.3] How to change the font size for all of the components of output within an af:panelBox?

    Hallo,

    I need to change the font size for all the inputTexts, LOVs of outputText, labels, etc. which are in different panelFormLayouts inside a panelBox.

    I tried to define a CSS class and to assign to the panelBox but it has not worked.

    You kindly suggest me an easy way to do this?

    Thank you

    Federico

    Hello

    You can try something like this:

    AF | panelBox::content label, af | panelBox::content, af | panelBox::content entry, af | panelBox::content select {}

    your style

    }

    At least the style of the components you named should be changed. If you need more you can add others.

    Kind regards

    Ruben.

  • Get the DDL for all tables in a schema;

    Hello

    I tried to get the DDL for all tables under my own diagram "A". Here are the steps I've tried, but in vain I
     1. logged in as a user A 
    2. And the ran query 
              
    SELECT DBMS_METADATA.get_ddl ('TABLE', 'XYZ')
    FROM user_tables
          
    o/p
    (HugecloB)
    
    {code}
    
    Any idea how i can get the DDL for all the tables under my own schema ?
    
    
    Thank you so much!
    
    Edited by: user642297 on Feb 4, 2011 12:05 PM
    
    Edited by: user642297 on Feb 4, 2011 12:05 PM
    
    Edited by: user642297 on Feb 4, 2011 12:05 PM
    
    Edited by: user642297 on Feb 4, 2011 12:07 PM                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        

    Your idea is good, you missed only to use the correct table name:

    SELECT DBMS_METADATA.get_ddl ('TABLE', table_name)
    FROM user_tables;
    

    Concerning

  • Get the latest date DML for all tables

    Hi gurus,

    Version - ORacle 11i

    I need to get a list of the tables that was not 'DML used' for a long time (updates/Inserts / (and selects too if available)). I searched for this in the forum and found 3 methods I used

    1 insert/update dtm
    ----------------------------------
      SELECT DISTINCT table_name, T.COLUMN_NAME
        FROM all_tab_cols t
       WHERE UPPER (T.COLUMN_NAME) LIKE 'UPD%'
             OR    UPPER (T.COLUMN_NAME) LIKE 'INSERT%'
               AND T.OWNER = 'STG'
               AND T.DATA_TYPE IN ('TIMESTAMP', 'DATE')
    ORDER BY column_name
    
    Issue- Not all the tables have inaert/upd dtm
    2 all_tab_modifications
    -------------------------------------
      SELECT table_Name, timestamp
        FROM all_tab_modifications t
       WHERE T.TABLE_OWNER = 'STG'
    ORDER BY timestamp ASC
    
    Issue - Not all tables are monitored
    3 ORA_ROWSCN
    ------------------------------------------
    select MAX(ORA_ROWSCN), SCN_TO_TIMESTAMP(MAX(ORA_ROWSCN)) from stg.XXXXXX
    
    Issue- This throws error MAX(ORA_ROWSCN) is not a valid input . ie for really old tables this throws error.
    How do I get there?

    Thank you
    S

    957793 wrote:
    Thank you peter.

    But one thing I noticed, sometimes at the time where I start an analysis table calculates statistics, the table disappears from the all_tab_modifications

    Thank you
    S

    Yes, makes the Act of analyzing a table disappears from the view of xxx_tab_modifications. It is because this view follows changes in the analyzed table have been modified in order to analyze the self employment can tell whether or not it must be analused "today."

    Assuming that you use more or less the default policy analysis that Oracle puts in place, it would be a pretty safe assumption that any which table not in xxx_tab_modifications had to be a substantial (as defined by the auto scan parameters) activity dml recently, or in other words did not have an important activity for a long time. You can make a difference based on the last_analyzed_date column in the xxx_tables view.

    John

  • Single request for the display of all, but the values of 1 column for all tables

    Hello

    All tables have the column SYS_CREATION_DATE.
    But I don't want to not display the value of this column

    Can anyone suggest a way in which I could achieve this?

    Oracle version: 11 GR 1 material
    OS: SunOS


    See you soon,.
    Malika

    Published by: user9131570 on July 6, 2010 19:57

    user9131570 wrote:
    @Tubby

    I * table-wise display the values of all but 1 columns (SYS_CREATION_DATE) in my database.*

    I need it to compare to another data base for all these values.

    I would like to make a wild guess at what you are getting.

    In view of these two tables

    create table emp
       (empid number,
        empname varchar2(15),
        empaddr   varchar2(15),
        sys_creation_date date);
    --
    create table dept
       (deptid number,
        deptmgr varchar2(10),
        sys_creation_date date);
    

    you want to combine somehow

    select empid,
             empname,
             empaddr
    from emp;
    

    with

    select deptid,
             deptmgr
    from dept;
    

    in a single sql statement?

  • for all tables of database

    Hello
    I found the following in the Oracle documentation for example: detection of Corruption (in the Guide10g Release 2 (10.2) B14231 - 02 of the administrator):
    SET SERVEROUTPUT ON
    DECLARE num_corrupt INT;
    BEGIN
    num_corrupt := 0;
    DBMS_REPAIR.CHECK_OBJECT (
    SCHEMA_NAME => 'SCOTT',
    OBJECT_NAME => 'DEPT',
    REPAIR_TABLE_NAME => 'REPAIR_TABLE',
    CORRUPT_COUNT => num_corrupt);
    DBMS_OUTPUT.PUT_LINE('number corrupt: ' || TO_CHAR (num_corrupt));
    END;
    /
    Can you help me to change it to check all tables in database?
    Thank you.

    Hello

    The last lines should be

    END LOOP;
    END;
    / 
    

    Concerning
    Peter

  • PowerShell script to change the DNS entries for all hosts

    Ive tried many others which have been posted on the web and none work... Someone at - it a script to change the DNS entries on all hosts?

    OK, changed a few pieces my end, it worked but now it's... Try this (50% confident

     $dnsServers = ("192.168.111.3","192.168.111.4")
    
     Get-VMHost | Get-View | %{
        $ns = Get-View -Id $_.configManager.networkSystem
        $dns = $ns.networkConfig.dnsConfig
    
         $dns.Address = @()
         foreach($server in $dnsServers) {
           $dns.Address += $server
       }
       $ns.UpdateDnsConfig($dns)
     }
    

    If you found this information useful, please consider the allocation of points for correct or helpful.

    Alan Renouf

    http://Virtu-al.NET

  • count (*) query for all tables in the user_tables

    How can I show count (*) for all the tables in the user_tables?

    Thanks in advance!
    Oracle 11g

    Published by: user598242 on October 7, 2010 09:19

    If you need the number of lines, you can create a script with:

    select 'select '''||table_name||''', count(*) from '||table_name||';' from user_tables;
    

    Use the output from this command as a script.

    Published by: hm on 07.10.2010 09:25

    Sorry: I corrected the order.

  • How to change the author notices for all documents?

    I just discovered the Note tool in Photoshop, which I think will be very useful to our society we are working a lot on projects.

    In my view, there is a way to add an author to individual notes, but there is nowhere to set the author for all future notes you create. This means that I have to put my name as the author on all notes whenever I'm doing a. It's rather inefficient.

    I searched for a way to set the author on a global scale in Photoshop, but could not find. Most programs programs for editing or commenting interfaces include this setting - Acrobat and Microsoft Office are the first to come to mind. I looked under preferences and found nothing and I have also tried all closing documents and enter my name as author, but Photoshop did not remember it the next time I tried to add a note.

    Does anyone know how to configure this? Or is it just that Adobe omis/forgot to include this feature?

    I also tried all closing documents and enter my name as author, but Photoshop did not remember it the next time I tried to add a note.

    Works for me, would there be a permissions problem?

    Could you post a screenshot with all images, closed and the visible Options bar?

  • Change the default print for all printing on OfficeJet Pro 8600 Plus

    OfficeJet Pro 8600 more

    10.8.3 OS iMac

    I want to change the value print factory set in the default print setting. I want the documents I send to the printer via AirPrint to print in black and white, not color. But the 8600 by default is always color. Sometimes, I am able to change this setting for individual tasks, but sometimes I can't. I wish that the default to be always in black and white. Is this possible?

    The steps above refer only to the Mac, indeed.

    AirPrint provides all color configurations, but only allow printing in color... all available Airprint parameters are listed in the What are the printing options are available? section below:

    http://support.HP.com/us-en/document/c02623193

    You can install the HP ePrint app and print through it, like black and white, know that color options are available for the types of documents only (PDF, TXT, MS Office files, Web sites or email), but not for the types of photo files:

    http://support.HP.com/us-en/document/c01923321

    Shlomi

  • changing the property index for all indexes of a model (OSDM 3.1 EA1)

    Is it possible to mass change to one of the properties of all the indexes in the model?

    For example, I have a data model with large number of indices.
    I created all these indexes with the clause of logging set to 'yes '.
    If I want to change to 'No', is there a way to do it without having to change the properties of each individual index?

    Can I use model index here? If Yes, can you please provide details on exactly how to use in this scenario?

    Hello

    The way to do is to change the JOURNALING property on one of the indexes.
    Reopen the Index on the Index Properties dialog box, then click on the button "propagate the properties.

    The dialog box properties of spread, deselect all properties with the exception of the journaling property and use "Select all" in the section 'Objects' of the dialog box to select all indexes updated.

    Index of models are used when the new indexes are created. You can use an Index model in order to have all new index you add logging set to 'no '.

    David

  • Change the default settings for all Mac on a wireless network, Officejet 6500n, Lion 10.7.4

    Hello

    In my view, there are a lot of discussions on change the print settings by default for printers hp in Leo, but my question is a little different. I have a network running on a wireless Netgear N600 router, and my HP Officejet 6500 is directly connected via USB. I want to set up the printer so that anyone who connects to the network via a mac wireless has the default value depending on parameters in any printing application:

    1. Quality: Fastdraft
    2. Color: gray
    3. Black cartridge only
    4. Print on both sides: long edge binding

    When I go to the page of the printer by entering the IP address in my browser, the administration utilities do not allow me to change the default settings and change the default settings in CUPS is useless since applications such as Safari, Word, and preview override these settings.

    Is that what I want possible?

    Thanks in advance.

    We gladly invite you.

    Indeed, that is right. When printing from a computer, the print settings can only be configured on the computer.

    The unit only will allow us to change this type of parameters for the work only stend, carried out from the device (e.g. copy or printing of the device using a memory card).

    Some business models can provide options to force parameters, print, but I'm afraid these capacities are not intended for consumer products.

    Kind regards

    Shlomi

  • Change the language settings for all programs

    My laptop is originally in the Norwegian language. I managed to change the English Office, but how to change to the English language, including Microsoft Office programs, etc.

    Hello

    Check out these links to learn more about,

    Install or change a display language

    http://Windows.Microsoft.com/en-us/Windows7/install-or-change-a-display-language

    Windows 7 language packs are available for computers that are running Windows 7 ultimate or Windows 7 Enterprise

    http://support.Microsoft.com/kb/972813

    Download languages for Windows

    http://Windows.Microsoft.com/en-us/Windows/downloads/languages

  • How to invoke the export and import of orders for all tables of pl/sql code?

    I want to export a few (not entire schema) tables from one database to another. But I want to run as a PL/SQL package so that I can call it from an application server. So my question is...

    How to call a tax / export commands from pl/sql code (SP or packaging) so that I can call these (SP or packaging) as a JDBC application server call?

    Krishna_Architect wrote:

    I want to export a few (not entire schema) tables from one database to another. But I want to run as a PL/SQL package so that I can call it from an application server. So my question is...

    How to call a tax / export commands from pl/sql code (SP or packaging) so that I can call these (SP or packaging) as a JDBC application server call?

    When all else fails, read the Fine

    The API data pump

Maybe you are looking for

  • Correct font not used

    The dropdown at the top of the Web site display correctly in Firefox 8.01. I appears correctly in IE, Chrome, and Opera. It seems to me that Firefox does not use the correct font for display, which causes the list to wrap instead of displaying on a s

  • How to set homepage to open new tabs

    Since the new Firefox 5, I've lost the add-on that defines my homepage (google) to open when I open a new tab. I really want this back. I looked through the list of Add-ons and that you did not find anything. Is there another way to do this?

  • GS752TS SSH connection

    Hello world! I had a GS752TS switch and I want to manage it remotely using SSH. But I can't find information on the SSH connection. I use Putty and it cannot connect. I also looked for the switch configuration: maintenance-online troubleshooting, but

  • Nonlinear worthy of the equations of the diode

    Hello I want to make an adjustment not length of the features of diodes. The function that I need to set up is could be written as Y = f (X, Y). This means that the data is both the goal of adjustment and a part of the equation. Is this possible with

  • HP Photosmart premium printer that disconnects constantly with my wireless setup.

    My Photosmart printer disconnects constantly.  I have to go to the Wireless Setup Wizard to bring him back.  I use a laptop HP pavilion dv6-321.  I also have 2 dell desktop computers that are connected is the same too.  I'm using Comcast as my ISP an