Create the table with aliases for columns

Hello

I don't know if its possible, but how do I define aliases for columns when I create a table (in fact, a global temporary Table - TWG)? The idea is to select the column using its name or its alias, like this:

SELECT nom_de_colonne FROM mytable

or

SELECT alias_de_colonne FROM MaTable

I work with Oracle9i Enterprise Edition Release 9.2.0.1.0


Thanks in advance.

You do not define aliases when you create a table, when you choose him.

I have to say... When you use it in a SQL statement (not just select).

Published by: SomeoneElse 18 Sep, 2008 15:10

Tags: Database

Similar Questions

  • How to create a table with two unique columns

    How to create a table with two unique columns. I use the following syntax below and I get the error message such unique or primary key already exists.

    create the table COPQ_WORKCELL_GOAL
    (
    Type_id varchar2 (4) NOT NULL UNIQUE,
    Tyle_Location varchar2 (30) NOT NULL UNIQUE,
    Type_Description varchar2 (20).
    KEY elementary SCHOOL (Type_id)
    );

    Use 1 or the other column type_id;

    create table COPQ_WORKCELL_GOAL
    (
      Type_id varchar2(4),
      Tyle_Location varchar2(30) NOT NULL UNIQUE,
      Type_Description varchar2(20),
      PRIMARY KEY (Type_id)
    );
    
    Table created
    drop table COPQ_WORKCELL_GOAL;
    
    Table dropped
    create table COPQ_WORKCELL_GOAL
    (
      Type_id varchar2(4) primary key,
      Tyle_Location varchar2(30) NOT NULL UNIQUE,
      Type_Description varchar2(20)
    );
    
    Table created
    
  • Creating the table with time stamp

    I need to create the table with the data inside buffer

    Can you help me pls

    If it works today,

    create the table test_04NOV2010 in select * from product where product_code = '101'

    If executed tmrw,

    create the table test_05NOV2010 in select * from product where product_code = '101'
    declare
    
    v_date varchar2(25);
    v_sql  varchar2(20);
    
    begin
    
    select to_char(sysdate,'DDMONYYYY') into v_date from dual;
    
     v_sql := ' create table ' ||TEST||'_'||'v_date'|| 
                 ' as '
                 ' select * from Product where product_code = '101'
              
     EXECUTE IMMEDIATE v_sql;
    
    end;
    can is it you pls let me know how to use it in PL SQL

    Can you help me pls

    Thank you very much
    declare
    
    v_date varchar2(25);
    v_sql  varchar2(2000); --Noted this. this was also small.
    
    begin
    
    select to_char(sysdate,'DDMONYYYY') into v_date from dual;
    
     v_sql := ' create table TEST_'||v_date||
                 ' as select * from Product where product_code = ''101''';
    
     EXECUTE IMMEDIATE v_sql;
    
    end;
    

    You can use the Q operator also.

    DECLARE
    
    v_date varchar2(25);
    v_sql  varchar2(2000);
    
    BEGIN
    
    select to_char(sysdate,'DDMONYYYY') into v_date from dual;
    
     v_sql := ' create table TEST_'||v_date||
                Q'[ as select * from Product where product_code = '101']';
    
     EXECUTE IMMEDIATE v_sql;
    
    END;
    

    Published by: mohamed on November 4, 2010 05:32

  • How to create the table with the description of the table

    Hello

    I would like to create the array with the description of the table (such as the creation of package or procedure with comments).

    Is it possible to achieve thanks to the oracle, if possible please help me achieve this goal.

    Thank you and best regards,

    Ibrahim Sayyed.

    > create table test (col1 number);

    > comment table test is "about a comment ';

    > select comments from user_tab_comments where table_name = 'TEST ';

    COMMENTS
    ____________________________________________________________________
    This is a comment

  • Create the table with the environment variables

    Hi all
    When an event occurs, I would create a table by a planning procedure.
    I can create a table with these last or similar syntax:

    create table % s_ %t in select acme_ * from a;

    I would use this syntax because this event could be spend more time per day and so I can check.
    is this possible?

    Thank you very much
    Ciao
    Alberto

    Albertofro wrote:
    Hi all
    When an event occurs, I would create a table by a planning procedure.
    I can create a table with these last or similar syntax:

    create table % s_ %t in select acme_ * from a;

    I would use this syntax because this event could be spend more time per day and so I can check.
    is this possible?

    Thank you very much
    Ciao
    Alberto

    To dynamically create a table, you must use EXECUTE IMMEDIATE. If you want your table to be padded with timestamp name you can do it with the function TO_CHAR and SYSDATE.

    An example

    execute immediate 'create table acme_' || to_char(sysdate, 'DDMMYYYYHH24MISS') || ' as select * from a';
    
  • How to create the table with the rows and columns using the layout?

    One of my friends advised me to put my site on the mode of provision as it is better than the standard as he said
    but I couldnot make an ordinary table with the rows and columns in mode available th
    y at - there someone who can tell me how to?
    Thank you very much

    Wednesday, April 18, 2007 21:01:38 + 0000 (UTC), "Mr.Ghost".
    wrote:

    > A friend of mine advised me to put my whole site on the mode of disposal as its
    > better than standard, as he says

    Your friend won't. Don't listen to him any more. Mode of disposal creates
    very fragile and rigid code pauses at the first opportunity.

    Gary

  • How to create the table with value list/map binding

    I need to display some values in a tabular format. It is possible to create a table adf without having value binds to a VO object. I can make a table with a combination of list/map.

    I want to change the format of display with minimum change in the application. I therefore seeks a change to a list/map and map with the table.

    Here is the structure in that I need to post.

    _______________________
    |     | Header1. Tete2 |
    |_______|_______|_______|
    | Txt R1 | value 1. Value 2.
    |_______|_______|_______|
    | Txt R2 | Value 3. value 4.
    |_______|_______|_______|

    All views is completely irrelevant. So I should not create a VO and add the VO object lines.

    Published by: yannick June 10, 2011 11:34

    Yes, you can do it. Create a pojo with properties (column) that you want to display in the table and create a list of instances of the POJO and then you can fill your table using the list.

    Sample:

    //POJO
    public class SamplePojo {
    
    private String col1;
    private String col2;
    
    public SamplePojo(String col1, String col2){
      this.col1 = col1;
      this.col2 = col2;
    }
    
    //add setter and getter methods
    }
    
    //Inside bean, prepare a list with pojo instances (Assume a getter exists for pojoList)
    pojoList = new ArrayList();
    pojoList .add(new SamplePojo("Value1", "Value2");
    pojoList .add(new SamplePojo("Value3", "Value4");
    etc.
    
    //Inside jspx
    
       
         
       
       
         
       
    
    

    HTH
    Jean Lou

  • Syntex to create the table with the long data type

    I'm looking to create a table based on another table that having the column long data type. Throw the error ORA-00997: illegal use of the LONG data type


    I tired it

    create table abc_long (ag bgd long number);

    create table abc_long_dummy as ( ) Select *of abc_long); - ORA-00997 error: illegal use of the LONG data type

    How to get there?

    I'm looking to create a table based on another table that having the column long data type.

    You really don't want to do that.

    LONG data type has been deprecated for some time now, use CLOB.

    The TO_LOB() function will do the conversion on the fly:

    create table abc_long_dummy
    as
    select ag
         , to_lob(bgd) as bgd
    from abc_long ;
    
  • create the table with the parameters of storage in a locally managed tablespace

    Hello
    Can we create object with the parameters of storage in a locally managed tablespace.

    CREATE TABLE my_hash_table_6)
    name VARCHAR2 (30),
    value VARCHAR2 (4000))
    STORAGE)
    INITIAL 1 M
    NEXT 512K
    PCTINCREASE 0
    MINEXTENTS 2
    MAXEXTENTS UNLIMITED)


    default tablespace users is successful locallly.
    Then extended this table management will be managed according to the tablespace or storage settings which
    has been specified when the table was created.

    Hello

    This means that we don't have to define NEXT, PCTINCREASE, MAXEXTENTS at the object level.
    Then, these settings are applicable to Dictionary managed tablespace or what?

    Yes that's right, understand you is correct

    Can we define NEXT, PCTINCREASE, MAXEXTENTS at the level of the object in the dictionary managed tablespace;

    Yes, you can, but go for DMT, is not very good, because you advantages compared to LMT, just think about it before going to the DMT, than I suggest.

    -Pavan Kumar N
    Oracle 9i / 10g - OCP
    http://oracleinternals.blogspot.com/

  • How to create a table with no lines to the left or to the right?

    If I create a table with say 5 columns and 15 lines, how not to do a vertical line (border) to the left and to the right of the table while keeping the boundary up and down? Is that possible or I just put a white box on the left and the right?

    IDCS3

    There are a few methods that work. Here is one.

    (1) select your table cells

    (2) open the race Panel

    3) click the blue lines of the proxy image in the Panel of stoke to deselect the lines inside and high and low lines

    (4) 0 the value of the weight of the race (or change the color of the None swatch)

    Oh and for the love of your fellow designers or the person that allows you to edit your work in the future... do NOT use a white box to hide the traits of lines and columns in the table.

    HTH

    -mt

  • Could not commit: ORA-00928: lack of creating the table SELECT keyword

    Hello guys.
    I tried to create the table with web interface on oracle 11g.

    I just follow this path on interface: schema-> table-> create-> standard (lot organized)-> SQl select on (set using the)->
    and I just use these scripts to create the table:

    CREATE TABLE suppliers
    (the number (10) of supplier_id not null,)
    supplier_name varchar2 (50) not null,
    Contact_Name varchar2 (50)
    );

    but this error occurred: failed to commit: ORA-00928: lack of SELECT key word!
    Please lock on this picture for more information: http://s17.postimg.org/kgoumzmvz/attachment.jpg

    could you help me please?
    and I could not find any manual for working with the web interface in oracle 11g.
    Please give me somesources to start.
    Thank you.

    1003778 wrote:
    Thank you sybrand_b
    but I already read this document.
    Unfortunately, there is nothing on the creation of table with sql scripts in this document!

    and I really don't understand how to create table with SQL commands! My question has not yet been answered.
    you please give me little details about it?
    for example, how can create table using this sql command:

    CREATE TABLE suppliers
    (the number (10) of supplier_id not null,)
    supplier_name varchar2 (50) not null,
    Contact_Name varchar2 (50)
    );

    Thank you.

    Edited by: 1003778 may 3, 2013 11:43

    When you got to the CREATE TABLE screen, you have selected "set using the--> SQL.
    Did you notice in the window that appears, just above this entry field is this text: "enter a SQL * select * statement below.» ' + This query results will be used to fill the table with Canada.* + "(underlining)
    And hip, just to the left of this field is this text: «CREATE TABLE AS»

    He tries to build a ' CREATE TABLE AS SELECT... ». Creates a table with the same structure as the table in which you SELECT and fills with the results of this SELECT '. With your entry, you create a CREATE TABLE AS CREATE TABLE to read statement...

    If you want to create your tables with a simple CREATE TABLE command, go to sqlplus and do it. You want to have a graphical interface to help build a simple CREATE table, when you get to the CREATE TABLE page, just to stay there with the default "use Define-> column specification." If you want, after completing "build" your table specification here, you will have a "Show sql" option to show you the actual sql statement that will be executed to create your table.

  • How to create a table with editable column values.

    Hello world
    I think it's very simple, but I am unable to find how to do this. This is my requirement. I need to create a table with n columns and 1 line initially. the user must be able to enter data into this table and click of a button must insert the data into the database table. Also, there should be a button at the bottom of the table to add 1 line to the table.

    I know how to do the insertion of data, but can someone please let me know how to create a table which allows the user to enter data and how to create a line button Add 1?


    Thanks in advance!

    Raghu,

    Go through the tutorial of Toolbox Page & Advanced section of the Guide of the OFA table.

    Step 1 - you need to create EO & VO from this EO. This EO will be table of database where you want to insert the data.

    Step 2 - create an advanced table region. (See this section in table advanced for more details)

    Step 3 - attach this VO in the BC4J region advanced Table component.

    Kind regards
    GYAN

  • Trying to create the table using Clause any Union with Select multiple stmts

    The motion seeks to get the substring of the value to for example.
    If the value is * ASA 2 * then so do ASA
    where as if the value is * 1.5 TST * it sholud come as TST as wise for others too.
    I am trying to execute stmt SQL written but in error as below:

    * ' ORA-00998 must appoint this expression with the alias column 00998.00000 - must appoint this expression with the column alias. "

    CREATE TABLE TEST_CARE AS
    (
    SELECT row_id, old_care_lvl, SUBSTR(old_care_lvl,3), len test_care_lvl FROM
    WHERE LENGTH (old_care_lvl) = 5
    UNION ALL
    SELECT row_id, old_care_lvl, SUBSTR(old_care_lvl,3), len test_care_lvl FROM
    WHERE LENGTH (old_care_lvl) = 7
    UNION ALL
    SELECT row_id, old_care_lvl, SUBSTR(old_care_lvl,3), len test_care_lvl FROM
    WHERE LENGTH (old_care_lvl) = 14
    UNION ALL
    Row_id SELECT, old_care_lvl, SUBSTR (old_care_lvl, 3), LEN test_care_lvl
    WHERE LENGTH = 7 AND old_care_lvl (old_care_lvl) = "Regular."
    );

    I want to create the table using the above given the multiple selection by using the Union ALL clause, but trying to create run query error like "ORA-00998 must appoint this expression with the alias column 00998.00000 - must appoint this expression with the column alias.

    Please guide me how to approach to solve this problem.
    Thanks in advance.

    Try this->

    CREATE TABLE TEST_CARE
    AS
      select *
      from (
              SELECT row_id, old_care_lvl,SUBSTR(old_care_lvl,3), len FROM test_care_lvl
              WHERE LENGTH(old_care_lvl) =5
              UNION ALL
              SELECT row_id, old_care_lvl,SUBSTR(old_care_lvl,3), len FROM test_care_lvl
              WHERE LENGTH(old_care_lvl) =7
              UNION ALL
              SELECT row_id, old_care_lvl,SUBSTR(old_care_lvl,3), len FROM test_care_lvl
              WHERE LENGTH(old_care_lvl) =14
              UNION ALL
              SELECT row_id, old_care_lvl,SUBSTR(old_care_lvl,3),LEN FROM test_care_lvl
              WHERE LENGTH(old_care_lvl) =7 AND old_care_lvl ='Regular'
          );
    

    N.B.: Not tested...

    Kind regards.

    LOULOU.

  • I want to change the table with the expression of dangerousness of the virtual columns with her, need advice

    Hi all

    Here is the structure of the table with two expression of virtual columns associated highlighted, now I want to delete these expressions with virtual columns (but must keep my VIRTUAL columns as it is).

    Is it possible the alter or I need to raise the table, make a new structure and copy content back to newly structured table... Pleae help!

    CREATE TABLE TEST_COL)

    SAGE_TRADE_TYPE VARCHAR2 (50 BYTE),

    LOCAL_TZ VARCHAR2 (20 BYTE),

    ACE GMT_CONV_ENTERED_DT_TS (SAGEDBO. FN_CONVERT_TIMEZONE (LOCAL_TZ, ENTERED_DT_TS)) VIRTUAL,.

    ACE GMT_CONV_EXECUTION_DT_TS (SAGEDBO. FN_CONVERT_TIMEZONE (LOCAL_TZ, UPSTREAM_EXECUTION_TS)) VIRTUAL,.

    EOD_IND VARCHAR2 (10 BYTE)

    );

    Thank you very much

    Arpit

    Try this

    ALTER table test_col change gmt_conv_entered_dt_ts (0) virtual;

    ALTER table test_col change gmt_conv_execution_dt_ts (1) virtual;

  • 'For' loop with a different number of iterations. Second, the auto-indexation of the tables with different sizes is done. It can affect the performance of the Vi?

    Hello

    I have a loop 'for' which can take different number of iterations according to the number of measures that the user wants to do.

    Inside this loop, I'm auto-indexation four different 1 d arrays. This means that the size of the tables will be different in the different phases of the execution of the program (the size will equal the number of measures).

    My question is: the auto-indexation of the tables with different sizes will affect the performance of the program? I think it slows down my Vi...

    Thank you very much.

    My first thought is that the compiler to the LabVIEW actually removes the Matlab node because the outputs are not used.  Once you son upward, LabVIEW must then call Matlab and wait for it to run.  I know from experience, the call of Matlab to run the script is SLOW.  I also recommend to do the math in native LabVIEW.

Maybe you are looking for

  • Need drivers for Windows XP only on Satellite A100-819

    I recently bought a toshiba laptop a100-819.I comes with pre-installed Windows Vista home premium.But I want to install XP Pro on it. If that's what I did. But it is great to find the correct drivers. Who can help me to find the correct drivers I nee

  • Project loses its files

    All of a sudden after reopening the project, much of files in the project have disappeared. The files are still on the disk. Some files were in virtual folders of project and others filled records automatically. All the filled automatically have turn

  • Pavilion dv7-4020sa

    bought this laptop there like "latest model" less than 3 months... It seems hp support assistant updated to "latest version" and lo & behold, nor my model number (dv7-4020sa), NOR the number of my product (WR867EA #ABU) can be found on the support pa

  • Ink

    How do I know when my ink runs out on my Eprinter B110

  • Disable the CAPS LOCK key.

    I did some research on the web on how to disable that pesky caps lock key, but I thought you guys could provide more reliable answers. I'm reasonably proficient with computers, but my fat fingers keep hitting the SHIFT KEY AND THEN EVERYTHING LOOKS L