NVARCHAR2 column in the select statement of the query


Hello

I have table

xx_test / / DESC

Name of Type Null

-------- -------- --------------

COL1 NOT NULL NVARCHAR2 (100)

COL2 NOT NULL NVARCHAR2 (100)

COL3 NOT NULL NVARCHAR2 (100)

I am able to interview

Select * from xx_test

However if the query as

Select col1 from xx_test

Then it is in error.

ORA-00904: "COL1": invalid identifier

00904, 00000 - '% s: invalid identifier '.

* Cause:

* Action:

Error on line: column 3-131: 13

Let me know how interrogate NVARCHAR2 column and how can we put in WHERE condition?

Thank you

Abhijit

Abhijit,

Now that you have already re-created the table, it would be difficult to find the exact cause. But I suspect it could happen due to the creation of table in a way not recommended the use of quotes.

If you use double quotes while creating the table/column names, you must always use capital letters. Better is not not to use quotes in all. Here is an example of a test that could be the cause of your error.

SQL > drop table test;

Deleted table.

SQL > create table test ("col1" nvarchar2 (200), col2 varchar2 (200));

Table created.

SQL > select Col1 from test;

Select Col1 from test

*

ERROR on line 1:

ORA-00904: "COL1": invalid identifier - it is him you got. Even if there is col1 column in the table, but I'm unable to select due to the bad way to appoint.

SQL > drop table test;

Deleted table.

SQL > create table test ("COL1" nvarchar2 (200), col2 varchar2 (200));

Table created.

SQL >

SQL > select col1 from test;

no selected line

The test case above apply to the tables as well.

Ishan

Tags: Database

Similar Questions

  • Get the types of columns in a select statement

    Hello

    Is there a way to get the types of columns that results in a select statement?

    For example to force an analysis on this topic and then look for the types of columns resulting in the view v$?

    Best regards

    Klaus Mogensen

    declare
      c       number;
      d       number;
      col_cnt integer;
      rec_tab dbms_sql.desc_tab;
      col_num number;
    begin
      c := dbms_sql.open_cursor;
      dbms_sql.parse(c, 'select dummy, 33 x, sysdate now from dual', dbms_sql.native);
      dbms_sql.describe_columns(c, col_cnt, rec_tab);
      col_num := rec_tab.first;
      while col_num is not null
      loop
        dbms_output.put_line( rec_tab(col_num).col_name || ' ' ||
                              case rec_tab(col_num).col_type
                                when 1 then 'varchar2'
                                when 2 then 'number'
                                when 12 then 'date'
                                else '???? ' || rec_tab(col_num).col_type
                              end
                            );
        col_num := rec_tab.next(col_num);
      end loop;
      dbms_sql.close_cursor(c);
    end;
    /
    DUMMY varchar2
    X number
    NOW date
    
  • Setting of the names of columns in the query in PivotChart

    Hi all

    I have columns for the wrong parameter names in a PivotChart query and I was wondering if someone could help me please understand me what I need to do.

    Help me help you, I have set up an example scenario in my hosted account. Here's the info to connect to my site hosted at [http://apex.oracle.com]
    Workspace: MYHOSTACCT
    Username : DEVUSER1
    Password : MYDEVACCT
    And here's my test request info:
    ID     : 42804
    Name   : dynamic query test
    Page   : 1
    Table 1: PROJECT_LIST         (Alias = PL...  Listing of Projects)
    Table 2: FISCAL_YEAR          (Alias = FY...  Lookup table for Fiscal Years)
    Table 3: PROJECT_FY           (Alias = PF...  Intersection table containing project fiscal years)
    Table 4: PROJECT_FY_HEADCOUNT (Alias = PFH... Intersection table containing headcount per project and fiscal year)
    Please forgive the excessive for this example standardization, as I wanted to keep the table structure similar to my actual application, that has a lot more going on.

    In my example, I have in the region to "Select the criteria", where the user specifies the project and the range of exercise that he or she would like to report. Click on the search button, and the report refers staff of revolving project for the range of the financial year.

    I've got it works using a query hardcoded, which is displayed in the region of the "hard-coded query." In this query, I have basically come back every year and to lay down the conditions on each column that determines if this column should be displayed or not according to the selected user. While this works, it is not ideal, because there could be several years more to take into account, and is not very dynamic. Any time an exercise is added to the table of FISCAL_YEAR, I update this page.

    So, after reading all the forums pivot OTN SQL and thread pivot "ask Tom", I was able to create a second region labeled "Dynamic motion" in which I created a dynamic query to return the same results. It of a much more intuitive solution and works very well; However, the column names are generic in the report.

    I had to put the query to analyze at runtime, because the list of column selection is dynamic, which violates the rules of SQL. Can someone help me please how can I specify my column names in the area of dynamic query to get the values of column even I receive in the region of hardcoded to understand?

    Please let me know if you need more information and thanks a lot in advance!

    Mark

    Take a look at your request now. I added a function in your workspace, change the headers to be pl/sql base, added an element hidden to contain the query you create and pass in the service to get your item headers...

    Thank you

    Tony Miller
    Webster, TX

    On the road of life... He has "windshield", and there are "bugs".
    (splat!)
    "Squeegees wanted."

    If you answer this question, please mark the thread as closed and give points where won...

  • By using the parameter as a column in a select statement inside the stored procedure.

    I'm doing a variation of what follows. Can someone tell me how to use the parameter passed in the IN clause correctly? Thank you
    drop table test1;
    drop table test2;
    
    CREATE TABLE TEST1
    (
      COL1  NUMBER
    );
    
    CREATE TABLE TEST2
    (
      COL2  NUMBER
    );
    
    insert into test1 values (1);
    insert into test2 values (1);
    
    commit;
    
    create or replace  procedure test_sp (col_name varchar2)
    as
    
    var1 number;
    begin
    
    select col1 into  var1 from test1 where col1 in (select col_name from test2);
    
    end;
    
    exec test_sp ('COL2');
    Deleted table.
    Deleted table.
    Table created.
    Table created.
    1 line of creation.
    1 line of creation.
    Validation complete.
    Created procedure.
    BEGIN test_sp ("COL2"); END;
    Error on line 29
    ORA-01722: invalid number
    ORA-06512: on-site ".» TEST_SP', line 7
    ORA-06512: at line 1

    You must use dynamic sql statements:

    SQL> drop table test1;
    
    Table dropped.
    
    SQL> drop table test2;
    
    Table dropped.
    
    SQL> CREATE TABLE TEST1
      2  (
      3    COL1  NUMBER
      4  );
    
    Table created.
    
    SQL> CREATE TABLE TEST2
      2  (
      3    COL2  NUMBER
      4  );
    
    Table created.
    
    SQL> insert into test1 values (1);
    
    1 row created.
    
    SQL> insert into test2 values (1);
    
    1 row created.
    
    SQL> commit;
    
    Commit complete.
    
    SQL> create or replace  procedure test_sp (col_name varchar2)
      2  as
      3  var1 number;
      4  begin
      5  execute immediate 'select col1 from test1 where col1 in (select ' || col_name || ' from test2)' into var1;
      6  end;
      7  /
    
    Procedure created.
    
    SQL> exec test_sp ('COL2');
    
    PL/SQL procedure successfully completed.
    
    SQL> 
    

    SY.

  • Question about how to calculate an additional column in the query result.

    Hello PL/SQL gurus and experts.

    I use Oracle Database 11 g Enterprise Edition Release 11.2.0.1.0 - 64-bit Production version


    Currently, I have the data in the following manner-
    drop table T2;
    create table T2(Year, MastTot, BechTot, Tot) as select
    '2008', '20000', '450000', '470000' from dual union all select
    '2008', '50000', '324000', '374000'  from DUAL union all select
    '2009', '25000', '450000', '475000'  from dual union all select
    '2009', '250000', '324000', '574000' from DUAL union all select
    '2010', '120000', '450000', '570000' from dual union all select
    '2010', '52000', '324000', '376000'  from DUAL union all select
    '2011', '220000', '450000', '670000' from dual union all select
    '2011', '52000', '324000', '376000'  from DUAL ;
    I want that data to present the following year (production).
    Year     MastTot     %Change     BechTot     %Change     Tot     %Change     %Total
    2009     275000     292.86     774000     0     1049000     24.29     27
    2010     172000     -37.45     774000     0     946000     -9.82     24.35
    2011     272000     58.14     774000     0     1046000     10.57     26.92
    Total     789000     313.54     3096000     0     3885000     25.04     78.28
    I use the following sql query-
    select decode(grouping(Year), 0, Year, 'Total') Year,
           To_Char(sum(MastTot), '999,999,999,999,999,999,999.99')  "MastTot",
           To_Char(sum(BechTot), '999,999,999,999,999,999,999.99')  "BechTot",
           To_Char(sum(Tot), '999,999,999,999,999,999,999.99')  "Tot",
           round((sum(Tot)/nullif(max(total_amount),0)) * 100, 2) "%Total"
      From
    (
    select Year,
           sum(MastTot) MastTot,
           sum(BechTot) BechTot,
           sum(Tot) Tot,
           SUM(Tot) over() total_amount
      From t2
    group by Year,Tot
    )
    where Year>'2008'
     group by grouping sets((Year),())
    order by Year
    But I am not able to read the % change column. Kindly help me with this.
    All the efforts and assistance in this regard is very appericated and I will be thankful to you...

    user555994 wrote:
    Thanks for the reply JAC,

    you are making reference to the line in the code

    round((sum(Tot)/nullif(max(total_amount),0)) * 100, 2) "%Total"
    

    Here, I'm looking for the Total % against the maximum value of the tot...

    SQL> with t
      2  as (
      3  select year,masttot,lag(masttot) over(order by year) prevm,
      4      BechTot,lag(BechTot) over(order by year) prevb,
      5      tot,lag(Tot) over(order by year) prevt,
      6      sum(tot) over(order by null) sm_t
      7  from(
      8  select Year,
      9         sum(MastTot) MastTot,
     10         sum(BechTot) BechTot,
     11         sum(Tot) Tot
     12  From t2
     13  group by Year
     14   ))
     15  select year,sum(masttot) masttot,
     16     sum(((masttot-prevm)/prevm)*100) Perc_m,
     17         sum(BechTot) bechtot,
     18         sum(((BechTot-prevb)/prevb)*100) Perc_b,
     19         sum(tot) tot,sum(((tot-prevt)/prevt)*100) Perc_t,
     20         sum((tot/sm_t)*100)  perc_total
     21  from t
     22  where year > 2008
     23  group by rollup(year);
    
          YEAR    MASTTOT     PERC_M    BECHTOT     PERC_B        TOT     PERC_T PERC_TOTAL
    ---------- ---------- ---------- ---------- ---------- ---------- ---------- ----------
          2009     275000 292.857143     774000          0    1049000 24.2890995  27.001287
          2010     172000 -37.454545     774000          0     946000 -9.8188751 24.3500644
          2011     272000 58.1395349     774000          0    1046000 10.5708245 26.9240669
                   719000 313.542132    2322000          0    3041000 25.0410489 78.2754183
    
  • Help - lines of the columns in the query

    I have table-
    CREATE TABLE group_device
    (group_id NUMBER (8) NON NULL
    member_id NUMBER (4) NOT NULL
    device_id NUMBER (10) NOT NULL
    , install_date DATE NOT NULL
    remove_date DATE
    );

    INSERT INTO group_device (group_id, member_id, device_id, install_date, remove_date) VALUES (10, 1, 123, TO_DATE (May 23, 2012 "," mm/dd/yyyy"), TO_DATE (May 28, 2012","mm/dd/yyyy"));
    INSERT INTO group_device (group_id, member_id, device_id, install_date, remove_date) VALUES (10, 1, 456, TO_DATE (May 28, 2012 "," mm/dd/yyyy"), TO_DATE (June 1, 2012","mm/dd/yyyy"));
    INSERT INTO group_device (group_id, member_id, device_id, install_date, remove_date) VALUES (10, 1, 789, TO_DATE (June 1, 2012 "," mm/dd/yyyy"), null);

    INSERT INTO group_device (group_id, member_id, device_id, install_date, remove_date) VALUES (10, 2, 999, TO_DATE (May 4, 2012 "," mm/dd/yyyy"), TO_DATE (May 17, 2012","mm/dd/yyyy"));

    INSERT INTO group_device (group_id, member_id, device_id, install_date, remove_date) VALUES (10, 4, 1123, TO_DATE (January 22, 2012 "," mm/dd/yyyy"), TO_DATE (January 27, 2012","mm/dd/yyyy"));
    INSERT INTO group_device (group_id, member_id, device_id, install_date, remove_date) VALUES (10, 4, 1456, TO_DATE (January 27, 2012 "," mm/dd/yyyy"), TO_DATE (January 28, 2012","mm/dd/yyyy"));
    commit;

    Select * from group_device;

    Current output does look like in below
    10 1 123 23 MAY 12 28 MAY 12
    10 1 456 28 MAY 12 1ST JUNE 12
    10 1 789 1 JUNE 12
    10 2 999 4 MAY 12 MAY 17, 12
    10 4 1123 22 JANUARY 12 JANUARY 27, 12
    10 4 1456 27 JANUARY 12 28 JANUARY 12



    Device_id - Replaced_device_id - remove_date: for group_id = 10

    for example, if member_id = 1, device_id = 123A replaced by device_id = 456 on 28 May 12
    DEVICE_ID = 456 was replaced by device_id = 789 on June 1, 12


    If the output should look like this

    10 123 456 28 May 12 - replaced
    10 456 789 1 June 12 - replaced
    10 789 - active


    Similarly there are many groups, so it should list group_id based on

    Thank you

    That match your desired output?

    select a.group_id, a.device_id, a.rep_device_id, a.rep_date, decode(NVL(a.rep_device_id, -1), -1, 'ACTIVE', 'REPLACED') rep_active
      from (
              select group_id, device_id, lead(device_id) over (partition by member_id order by install_date) rep_device_id,
                     lead(install_date) over (partition by member_id order by install_date) rep_date
                from group_device
           ) a;
    
    GROUP_ID  DEVICE_ID REP_DEVICE_ID REP_DATE  REP_ACTIVE
    -------- ---------- ------------- --------- ----------
          10        123           456 28-MAY-12 REPLACED
          10        456           789 01-JUN-12 REPLACED
          10        789                         ACTIVE
          10        999                         ACTIVE
          10       1123          1456 27-JAN-12 REPLACED
          10       1456                         ACTIVE     
    
     6 rows selected 
    

    Oracle 11g is not a version. Therefore, please do not forget to post the output of

    select * from v$version;
    
  • Arrange the columns in the query

    This is my request

    < cfset total = queryNew ("TotalPointsEarned, EarnedPointsCost, TotalPointsRedeemed, RedeemedPointsCost, sreedemedHandling, RedemedTotal, TotalPointsUnRedeemed, UnRedeemedPointsCost, PointsUnreedemed manipulation, UnRedemedTotal") >
    < cfset queryAddRow (total) >
    < cfset querySetCell (totals, "TotalPointsEarned", "#DecimalFormat (TotalPointsEarned) #") >
    < cfset querySetCell (totals, "EarnedPointsCost", "#DecimalFormat (EarnedPointsEarned) #") >
    < cfset querySetCell (totals, "TotalPointsRedeemed", "#DecimalFormat (ALLTotalPoints) #") >
    < cfset querySetCell (totals, "RedeemedPointsCost", "#DecimalFormat (ALLPoints_Cost) #") >
    < cfset querySetCell (totals, "PointsreedemedHandling", "#DecimalFormat (Handling) #") >
    < cfset querySetCell (totals, "RedemedTotal", "#DecimalFormat (Total) #") >
    < cfset querySetCell (totals, "TotalPointsUnRedeemed", "#DecimalFormat (ALLTotalUnredeemed) #") >
    < cfset querySetCell (totals, "UnRedeemedPointsCost", "#DecimalFormat (ALLUnredeemed_points) #") >
    < cfset querySetCell (totals, "PointsUnreedemedHandling", "#DecimalFormat (Unred_Handling) #") >
    < cfset querySetCell (totals, "UnRedemedTotal", "#DecimalFormat (TotalHandling) #") >

    < cfdump var = "" #totals # "> < cfabort >"

    The problem is, if I throw, the request doen't put cells in the same order that I've created. He autoArranges in alphabetical order. Can anyone help please?

    It is the sequence I want.

    TOTALPOINTSEARNED
    EARNEDPOINTSCOST
    TOTALPOINTSREDEEMED
    REDEEMEDPOINTSCOST
    POINTSREEDEMEDHANDLING
    REDEMEDTOTAL
    TOTALPOINTSUNREDEEMED
    UNREDEEMEDPOINTSCOST
    POINTSUNREEDEMEDHANDLING
    UNREDEMEDTOTAL

    But, this is the sequence that I receive.


    EARNEDPOINTSCOST
    POINTSREEDEMEDHANDLING
    POINTSUNREEDEMEDHANDLING
    REDEEMEDPOINTSCOST
    REDEMEDTOTAL
    TOTALPOINTSEARNED
    TOTALPOINTSREDEEMED
    TOTALPOINTSUNREDEEMED
    UNREDEEMEDPOINTSCOST
    UNREDEMEDTOTAL

    Any help will be much appreciated.

    See you soon.

    This is my request












    The problem is, if I throw, the request doen't put cells in the same order that I've created. He autoArranges in alphabetical order. Can anyone help please?

    It is the sequence I want.

    TOTALPOINTSEARNED
    EARNEDPOINTSCOST
    TOTALPOINTSREDEEMED
    REDEEMEDPOINTSCOST
    POINTSREEDEMEDHANDLING
    REDEMEDTOTAL
    TOTALPOINTSUNREDEEMED
    UNREDEEMEDPOINTSCOST
    POINTSUNREEDEMEDHANDLING
    UNREDEMEDTOTAL

    But, this is the sequence that I receive.

    EARNEDPOINTSCOST
    POINTSREEDEMEDHANDLING
    POINTSUNREEDEMEDHANDLING
    REDEEMEDPOINTSCOST
    REDEMEDTOTAL
    TOTALPOINTSEARNED
    TOTALPOINTSREDEEMED
    TOTALPOINTSUNREDEEMED
    UNREDEEMEDPOINTSCOST
    UNREDEMEDTOTAL

    Any help will be much appreciated.

    See you soon.

  • Add additional columns to a select * statement?

    is there a way to do something like:
    select *, table_A.value*.25 from table_A
    Thank you

    Edited by: nwill on January 14, 2010 08:14

    '25' is a constant? If I understand you right, you can do this:

    select table_A.*, 25 from table_A;
    
  • Value of the item as column name to select

    Hello

    I have a problem with the selection of the columns in the query using elements. For example: I have a request:
    Select column_a table; or select table column_b;

    and I want to do something like this:
    n ' any item where I choose the column name
    -query: select column_from_item from the tale of

    Is this possible?
    My version of the apex: 4.0.2.00.07
    My version of db oracle: oracle 11g

    Hello

    Create a report... type... as a function returning the SQL statement...

    and then you source should be something like

    declare
       my_sql_statement varchar2(1000);
    begin
       my_sql_statement := 'select ' || :p1_x || ' from table';
       return my_sql_statement;
    end;
    

    Kind regards
    Shijesh

  • Add more than 2 lines for a select statement without inserting rows in the base table

    Hi all

    I have a below a simple select statement that is querying a table.

    Select * from STUDY_SCHED_INTERVAL_TEMP
    where STUDY_KEY = 1063;

    but here's the situation. As you can see its return 7 ranks. But I must add
    2 rows more... with everything else, default or what exist... except the adding more than 2 lines.
    I can't insert in the base table. I want my results to end incrementing by 2 days in
    measurement_date_Taken on 01-APR-09... so big measurement_date_taken expected to
    end at study_end_Date...



    IS IT STILL POSSIBLE WITHOUT INSERT ROWS IN THE TABLE AND PLAYIHY ALL AROUND WITH
    THE SELECT STATEMENT?

    Sorry if this is confusing... I'm on 10.2.0.3

    Published by: S2K on August 13, 2009 14:19

    Well, I don't know if this request is as beautiful as my lawn, but seems to work even when ;)
    I used the "simplified" version, but the principle should work for your table, S2K.
    As Frank has already pointed out (and I fell on it while clunging): simply select your already existing lines and union them with the 'missing documents', you calculate the number of days that you are "missing" based on the study_end_date:

    MHO%xe> alter session set nls_date_language='AMERICAN';
    
    Sessie is gewijzigd.
    
    Verstreken: 00:00:00.01
    MHO%xe> with t as ( -- generating your data here, simplified by me due to cat and lawn
      2  select 1063 study_key
      3  ,      to_date('01-MAR-09', 'dd-mon-rr') phase_start_date
      4  ,      to_date('02-MAR-09', 'dd-mon-rr') measurement_date_taken
      5  ,      to_date('01-APR-09', 'dd-mon-rr') study_end_date
      6  from dual union all
      7  select 1063, to_date('03-MAR-09', 'dd-mon-rr') , to_date('04-MAR-09', 'dd-mon-rr') , to_date('01-APR-09', 'dd-mon-rr') from dual union all
      8  select 1063, to_date('03-MAR-09', 'dd-mon-rr') , to_date('09-MAR-09', 'dd-mon-rr') , to_date('01-APR-09', 'dd-mon-rr') from dual union all
      9  select 1063, to_date('03-MAR-09', 'dd-mon-rr') , to_date('14-MAR-09', 'dd-mon-rr') , to_date('01-APR-09', 'dd-mon-rr') from dual union all
     10  select 1063, to_date('03-MAR-09', 'dd-mon-rr') , to_date('19-MAR-09', 'dd-mon-rr') , to_date('01-APR-09', 'dd-mon-rr') from dual union all
     11  select 1063, to_date('22-MAR-09', 'dd-mon-rr') , to_date('23-MAR-09', 'dd-mon-rr') , to_date('01-APR-09', 'dd-mon-rr') from dual union all
     12  select 1063, to_date('22-MAR-09', 'dd-mon-rr') , to_date('30-MAR-09', 'dd-mon-rr') , to_date('01-APR-09', 'dd-mon-rr') from dual
     13  ) -- actual query:
     14  select study_key
     15  ,      phase_start_date
     16  ,      measurement_date_taken
     17  ,      study_end_date
     18  from   t
     19  union all
     20  select study_key
     21  ,      phase_start_date
     22  ,      measurement_date_taken + level -- or rownum
     23  ,      study_end_date
     24  from ( select study_key
     25         ,      phase_start_date
     26         ,      measurement_date_taken
     27         ,      study_end_date
     28         ,      add_up
     29         from (
     30                select study_key
     31                ,      phase_start_date
     32                ,      measurement_date_taken
     33                ,      study_end_date
     34                ,      study_end_date - max(measurement_date_taken) over (partition by study_key
     35                                                                          order by measurement_date_taken ) add_up
     36                ,      lead(measurement_date_taken) over (partition by study_key
     37                                                          order by measurement_date_taken ) last_rec
     38                from   t
     39              )
     40         where last_rec is null
     41       )
     42  where rownum <= add_up
     43  connect by level <= add_up;
    
     STUDY_KEY PHASE_START_DATE    MEASUREMENT_DATE_TA STUDY_END_DATE
    ---------- ------------------- ------------------- -------------------
          1063 01-03-2009 00:00:00 02-03-2009 00:00:00 01-04-2009 00:00:00
          1063 03-03-2009 00:00:00 04-03-2009 00:00:00 01-04-2009 00:00:00
          1063 03-03-2009 00:00:00 09-03-2009 00:00:00 01-04-2009 00:00:00
          1063 03-03-2009 00:00:00 14-03-2009 00:00:00 01-04-2009 00:00:00
          1063 03-03-2009 00:00:00 19-03-2009 00:00:00 01-04-2009 00:00:00
          1063 22-03-2009 00:00:00 23-03-2009 00:00:00 01-04-2009 00:00:00
          1063 22-03-2009 00:00:00 30-03-2009 00:00:00 01-04-2009 00:00:00
          1063 22-03-2009 00:00:00 31-03-2009 00:00:00 01-04-2009 00:00:00
          1063 22-03-2009 00:00:00 01-04-2009 00:00:00 01-04-2009 00:00:00
    
    9 rijen zijn geselecteerd.
    

    Is there a simpler way (in SQL), I hope that others join, and share their ideas/example/thoughts.
    I feel that it is using more resources there.
    But I have to cut the daisies before now, they interfere my 'grass-green-ess";)

  • Display of the results of the query with the column names unknown

    I use this code to grab the headers of columns in a select * statement. (I never know what table is queried out of 12 000 or more.) I want to make a loop on the column headers, then the query results in a web page table.

    < cfoutput >
    < cfset colHeaderNames = ArrayToList (recordset1.getColumnList ()) / >
    #colHeaderNames #.
    < / cfoutput >

    Is there a similar method or suggestions for the release of the results of the query - now that I know the column headings?

    If I understand correctly, you can do something like the code below.

  • SQL query * I want to insert a file column in the other table based on two columns

    I want to insert a column records to another table based on two columns

    the query below does not work

    insert into def_ver_lnki_p (job_name)

    Select def_job.job_name

    from def_job where def_job.job_id = def_ver_lnki_p.job_id and def_job.table_id = def_ver_lnki_p.table_id;

    Just to correct sql

    Update

    def_ver_lnki_p define job_name =)

    Select def_job.job_name

    of def_job

    where def_job.job_id = def_ver_lnki_p.job_id

    (and def_job.table_id = def_ver_lnki_p.table_id);

  • Querying the oracle table that has a column with the name of "FILE".

    Hi all

    I need to have an oracle table that has the column with the name "FILE".

    I can query all columns with the query "select * from table".

    But I'm not able to use the query "select the table file.

    This table is converted from ms access to oracle and I need to have this column with the name "FILE".

    Any suggestions?

    Thank you

    Abdellaoui

    Hello

    FILE is a keyword from Oracle, so it's not a good name,

    Use FILEDATE, or DATE_FILED, or something else that is not in V$ RESERVED_WORDS. KEYWORD as the name column.

    If you need to use the FILE, then you must use quotation marks.

  • Display the data type of a column in the status bar

    Hi all

    n pl/sql developer, when I select a column in a table.

    If I clicked with the mouse on the column in the query results box, it shows me the type of data and the size of the column in the status bar

    Developer SQL does not by default,

    is there an option I can change to do the same task?

    Thank you

    No, you will need to open a popup DESC of the query to see the data types of the data returned.

  • Print the name of the column by using the query

    Hello

    I need to print the column name and the number of number of columns i.e. columns in the query below. Please suggest me how to print

    SELECT
    E.EMPNO,
    E.ENAME,
    D.DEPTNO
    FROM EMP E,.
    D DEP.
    WHERE
    E.DEPTNO = D.DEPTNO

    Please suggest

    Thank you
    Sudhir

    Re: get the title of column
    http://saubbane.blogspot.com/2011/01/how-to-find-column-count-of-query.html
    Re: writing data from table to file

    Published by: Johan July 5, 2011 16:28

Maybe you are looking for