ORA-00904: invalid identifier

have a problem with this select statement:
select NLS_CHARACTERSET, NLS_NCHAR_CHARACTERSET, NLS_TERRITORY, NLS_LANGUAGE, NLS_SORT from nls_database_parameters ORDER BY PARAMETER
ERROR at line 1:
ORA-00942: table or view does not exist
but if I do this :
select * from nls_database_parameters ORDER BY PARAMETER
I get all results right.
How can I get the result by columns that i need?
Thanks a lot,
mj

The columns you are attempting to select are not columns but values for parameter.
SQL> describe nls_database_parameters
Name                                      Null?    Type
PARAMETER                                 NOT NULL VARCHAR2(30)
VALUE                                              VARCHAR2(40)
SQL>
SQL> l
  1  select *
  2  from nls_database_parameters
  3  where parameter in ('NLS_CHARACTERSET', 'NLS_NCHAR_CHARACTERSET',
  4                      'NLS_TERRITORY', 'NLS_LANGUAGE', 'NLS_SORT')
  5* order by parameter
SQL> /
PARAMETER                      VALUE
NLS_CHARACTERSET               WE8ISO8859P1
NLS_LANGUAGE                   AMERICAN
NLS_NCHAR_CHARACTERSET         AL16UTF16
NLS_SORT                       BINARY
NLS_TERRITORY                  AMERICA
SQL>

Similar Messages

  • Discoverer report :ORA -00904 Invalid Identifier

    Hi ,
    we are using an apps mode EUL (version4i) ,
    in the business area "Account Receivables"--->Customer Transaction Lines Folder,
    when we pull up any item from this folder to create a report, it shows a
    "ORA-00904 Invalid Identifier " error
    how to fix it , whether the Item might be Deleted in view definition of this folder,
    just a refresh of the folder is enough ?
    thanks in advance

    Hi,
    Refreshing the folder should be your first step.
    Rod West

  • IR: ORA-20001: get_dbms_sql_cursor error ORA-00904: : invalid identifier

    Hi everyone,
    has anyone else had this error which has been driving me round the bend during the last three days?
    I have an interactive report which used to work fine.
    Now it happens (when the page loads/a filter is en- or disabled) that - from time to time, but unpredictable - I receive
    ORA-20001: get_dbms_sql_cursor error ORA-00904: : invalid identifier
    The report is based on a table function.
    I will try to set up a testcase and post the link here, but so far I haven't managed to force the error to occur.
    But maybe someone else has already bumped into this kind of error? I would be grateful for any hints!
    Best regards,
    Sabine
    Application Express 4.1.0.00.32
    Oracle Database 11g Enterprise Edition Release 11.2.0.3.0 - 64bit Production

    Hi Jari,
    I changed the type definition (the return type of the table function) and extended the select list in the source of the IR.
    I do not use 'select *' but reference every column explicitly. So APEX easked me whether to add the new column.
    I also tried deleting in recreating the region, but no luck.
    Any more ideas?
    Best regards,
    Sabine

  • Why do I get a "DATE1 : ORA-00904 Invalid identifier" error ?

    Hi,
    Despite my efforts, I can't see why I get a "DATE1 : ORA-00904 Invalid identifier' error whith this request.
    {code}With S1 as (
    SELECT TRUNC(DATE1, 'MM'),
    ROUND(SUM(VALEUR), 2)
    FROM EVV_E036
    GROUP BY TRUNC(DATE1, 'MM')
    ORDER BY TRUNC(DATE1, 'MM'))
    SELECT n,
    NVL(ROUND(SUM(Valeur),2), 0)
    FROM (select add_months(to_date('01/01/2006', 'dd/mm/yyyy'), level - 1) n FROM dual connect by level <= 12) months
    LEFT JOIN S1
    ON months.n = TRUNC(DATE1, 'MM')
    GROUP BY n
    ORDER BY n{code}
    The line in error is this one : {code}ON months.n = TRUNC(DATE1, 'MM'){code}
    Any idea much appreciated !
    Regards,
    Christian

    hi,
    I have done this and get no more errors. Now I see that the values I get are equal to 0. Or, I do get values different from 0 in my table ! I can't see why the left join gives 0. I have to dig this and come back tomorrow.
    With S1 as (
    SELECT TRUNC(DATE1, 'MM') Date1,
           ROUND(SUM(VALEUR), 2) Debit
    FROM   EVV_E036
    WHERE  CLEF_VAR = (SELECT CLEF_VAR FROM SITE_ECHELLE WHERE SITE = 'E036')
    AND    DATE1 BETWEEN TO_DATE ('01/01/2007000000', 'DD/MM/YYYYHH24MISS') AND TO_DATE ('31/12/2007235959', 'DD/MM/YYYYHH24MISS')
    GROUP  BY TRUNC(DATE1, 'MM')
    ORDER  BY TRUNC(DATE1, 'MM'))
    SELECT n,
           NVL(ROUND(SUM(Debit),2), 0)
    FROM   (select add_months(to_date('01/01/2006', 'dd/mm/yyyy'), level - 1) n FROM dual connect by level <= 12) months
    LEFT JOIN S1
         ON months.n = date1
    GROUP BY n
    ORDER BY n

  • Internal SYS_OP_ATG function generates "ORA-00904: : invalid identifier"

    After gathering system statistics a MERGE statement within a PLSQL block now always raises "ORA-00904: : invalid identifier". Investigation points to internal SQL executed by the CBO using the SYS_OP_ATG function to be the culprit. What is this function and why does it raise "ORA-00904: : invalid identifier"? As a temporary solution deleting system statistics has made the problem disappear. My concern is that it will reappear.
    Merge statement is within a procedure within a package. Nothing had been re-compiled. System statistics were gathered then the following statement errors every time. There is an exception handler around it which raises the "ORA-00904: : invalid identifier". Delete system stats and it all works fine again:
    MERGE INTO lp_data lp
    USING (
    SELECT
    f.ubimsg_id ubimsg_id,
    f.endpoint_id endpoint_id,
    f.msg_created_date msg_created_date,
    t.end_time end_time,
    DECODE(t.units_used,255,0, t.units_used) units_used,
    DECODE(t.units_used,255,'N', 'Y') reading_received
    FROM TABLE (CAST (tab_lp_values AS load_profiles)) t,
    (SELECT ubirec.ubimsg_id ubimsg_id ,ubirec.endpoint_id endpoint_id, ubirec.msg_created_date msg_created_date FROM dual) f
    ) lp_rec
    on (lp.endpoint_id = lp_rec.endpoint_id
    and lp.end_time = lp_rec.end_time)
    when matched then
    update set lp.entry_date = lp_rec.msg_created_date,
    lp.ubimsg_id = lp_rec.ubimsg_id,
    lp.units_used = lp_rec.units_used / 10,
    lp.reading_received = lp_rec.reading_received
    when not matched then
    insert (lp.endpoint_id,
    lp.end_time,
    lp.entry_date,
    lp.ubimsg_id,
    lp.units_used,
    lp.reading_received)
    values (lp_rec.endpoint_id,
    lp_rec.end_time,
    lp_rec.msg_created_date,
    lp_rec.ubimsg_id,
    lp_rec.units_used / 10,
    lp_rec.reading_received );
    The line FROM TABLE (CAST (tab_lp_values AS load_profiles)) t casts a plsql object collection. An SQL trace showed the following SQL which must be internal SQL generated for the MERGE statement.
    SELECT distinct TBL$OR$IDX$PART$NUM("LP_DATA", 0, 1, 0, "END_TIME") FROM
    (SELECT "LP_REC"."END_TIME" "END_TIME" FROM (SELECT :B1 "UBIMSG_ID",:B2 "ENDPOINT_ID",:B3 "MSG_CREATED_DATE",
    SYS_OP_ATG(VALUE(KOKBF$),1,2,2) "END_TIME",
    DECODE(SYS_OP_ATG(VALUE(KOKBF$),2,3,2),255,0,SYS_OP_ATG(VALUE(KOKBF$),2,3,2)) "UNITS_USED",
    DECODE(SYS_OP_ATG(VALUE(KOKBF$),2,3,2),255,'N','Y') "READING_RECEIVED"
    FROM TABLE(CAST(:B4 AS "LOAD_PROFILES") ) "KOKBF$","SYS"."DUAL" "DUAL") "LP_REC") ORDER BY 1
    Without system statistics the trace did not have this statement in it, and the explain plan for the MERGE differed.
    Oracle 11.1.0.7.0 Windows 32-BIT.
    select * from v$version;
    Oracle Database 11g Enterprise Edition Release 11.1.0.7.0 - Production
    PL/SQL Release 11.1.0.7.0 - Production
    CORE 11.1.0.7.0 Production
    TNS for 32-bit Windows: Version 11.1.0.7.0 - Production
    NLSRTL Version 11.1.0.7.0 - Production
    SQL> show parameter compatible
    compatible string 11.1.0.0.0
    Any help to explain / resolve this issue would be much appreciated.

    Duplicate thread: CBO on 11G generates ORA-00904 with SYS_OP_ATG

  • Advanced Conditions causing ORA-00904 invalid identifier

    I have another weird thing going on...
    It may be the complexity of the data I'm pulling, but I'm going to simplify the problem first...
    I have several conditions in my workbook that I need to be true regardless then I need the following (this is a payroll thing):
    ((Total Regular Hours > 40 AND Total Overtime = 0) OR (Total Overtime > 0 AND (Total Regular Hours - Total Overtime Hours) <> 40))
    So, I'm using Discoverer Plus 10g and if I create separate conditions for Total Overtime > 0 and (Total Regular Hours - Total Overtime Hours) <> 40) it will work, but if I try to combine them into one condition (so I can then add my OR and the other 2 conditions) it gives me the "ORA-00904 invalid identifier" error and will not run.
    The only way I've been able to do it is to create 3 conditions and 2 worksheets. That way, I can add (Total Regular Hours > 40 AND Total Overtime = 0) in one condition and apply it to one sheet; then I the other 2 separate conditions can be applied to the other worksheet.
    I hate having to have 2 worksheets when I should be able to create an advanced condition... anyone have any ideas?
    Regards,
    Emily

    It is actually a typo in the message because I have a calculated column that calculates the difference... sorry.
    I did try the idea of running the SQL that was generated in SQL Developer and it doesn't look right.
    It did all my other conditions under the where, but then where I would have thought it should do another and it did a WHERE.... see below. (I only pasted from the from statement on to save room)
    FROM HRBG_PEOPLE_ASSIGNMENT o393615, APPS.PTEN_PAY_BEE_V o393616
    WHERE ( (o393616.ASSIGNMENT_ID = o393615.ASSIGNMENT_ID))
    AND (o393615.BG_SECURITY_FLAG_CODE = 'Y')
    AND (o393616.DATE_EARNED BETWEEN o393615.ASSIGNMENT_START_DATE AND o393615.ASSIGNMENT_END_DATE AND o393616.DATE_EARNED BETWEEN o393615.RECORD_START_DATE AND o393615.RECORD_END_DATE)
    AND (o393616.DATE_EARNED IN (:"Date Earned Dates"))
    AND (o393616.EFFECTIVE_DATE = :"Period End Date")))))
    WHERE ( ( NP100 ) > 40 AND ( NP101 ) = 0)
    AND ( ( NP104 ) <> 40 AND ( NP105 ) > 0)
    ORDER BY E393849 ASC ;
    Do you see the WHERE that I marked in BOLD? That should be an AND...
    I even tried creating one crazy long condition to include everything in one and still got the same error and it produced the same SQL. I am thinking it has to do with the fact that I'm actually showing group totals for Regular Hours and Overtime and then subtracting them to get the difference. It all breaks when I add that difference in with the others. If I keep it separate, it does fine.
    By the way, the error I get when running just the SQL is "not all variables bound"
    Thanks,
    Emily

  • PL/SQL: ORA-00904: invalid identifier (DG4ODBC 11.2.0.2 & MySQL)

    I have a PL/SQL script processing information between Oracle database and MySQL database. My script ran perfectly with DG4ODBC 11.1.0.7. Then we upgraded Oracle to 10.2.0 and DG4ODBC 11.2.0.2. Now if I run my script from Solaris command line like ./myscript.shl, I get the following errors:
    PL/SQL: ORA-00904: "cmswhit_moodle1"."mdl_grade_grades"."finalgrade": invalid identifier
    PL/SQL: ORA-00904: "cmswhit_moodle1"."mdl_question_states"."attempt": invalid identifier
    The strange thing is if I run the same query by cut and paste into sqlplus from command line, the query works perfectly without any problems.
    What is the cause of this problem?
    Any help would be greatly appreciated.
    Jeffrey

    Hi Klaus,
    The problem was solved after I updated MySQL ODBC to a new version from 5.1.8 to 5.1.13.
    Summary of the problem and its solution:
    The Problem: It appears that dg4odbc 11.2.0.2 requires a newer version of MyODBC. Previously I used MyODBC 5.1.8 which ran into problems with dg4odbc 11.20.0.2.
    The Solution: After I updated MyODBC to 5.1.13, my PL/SQL scripts all work.
    I need to point out that with MyODBC 5.1.8, I can run queries and updates from SQL*Plus console, but now PL/SQL scripts.
    I'll close this thread.
    Once again, thank you and happy holidays.
    Jeffrey

  • Error ORA-00904  invalid identifier

    There are so many different employee rates colums in the employee table .
    e.g)
    emp_rate_1 column has all different salaries(10,20,30)
    emp_rate_2 column has all different salaries(20,30,40)
    If I do pick up one rate , it works fine as below
    select
         SUM(emp_rate_1) as emp_rate_1
                   from employee_t
    result $60
    but i have to summarize all different rate amount using loop. before looping method,
    I tried as simple like below
    declare
    V_emp_rate_1_ID number;
    begin
    V_emp_rate_1_ID :=1;
    select
         SUM(emp_rate_||trim(V_emp_rate_1_ID)) as emp_rate_1
                   from employee_t ;
    end;
    I have an error message;
    PL/SQL: ORA-00904: "emp_rate_": invalid identifier
    ORA-06550: line 5, column 1:
    PL/SQL: SQL Statement ignored
    06550. 00000 - "line %s, column %s:\n%s"
    *Cause:    Usually a PL/SQL compilation error.
    *Action:
    how can I put dynamic column into Sum() in the query?
    or would you give me your advice to solve the solution.

    Not clear whether you are trying to get two sums (one for each column) or one sum that totals both columns)
    select
    SUM(emp_rate_1) as emp_rate_1
    from employee_t
    result $60But you can do all three with one query
    select
    SUM(emp_rate_1) as emp_rate_1, sum(emp_rate_2) as emp_rate_2, sum (emp_rate_1 + emp_rate_2) as sum_both
    from employee_t

  • Dynamic SQL Issue ORA-00904:invalid identifier error

    Here is my SP
    create or replace procedure srini_ref_cursor_test(p_county_code IN VARCHAR2,
    p_ref_cur out PK_FR_TYPES.cursor_type) is
    query_str varchar2(5000);
    begin
    query_str := 'SELECT * FROM dw_county where county_name = :P ';
    open p_ref_cur for query_str USING p_county_code;
    insert into srini_query_str_test values (query_str);
    commit;
    end srini_ref_cursor_test;
    When I pass the p_county_code = Adams working find.
    create or replace procedure srini_ref_cursor_test(p_county_code IN VARCHAR2,
    p_ref_cur out PK_FR_TYPES.cursor_type) is
    query_str varchar2(5000);
    begin
    query_str := 'SELECT * FROM dw_county where county_name in ('||p_county_code||')';
    open p_ref_cur for query_str;
    insert into srini_query_str_test values (query_str);
    commit;
    end srini_ref_cursor_test;
    When I pass the p_county_code = Adams for above SP I got the following error
    ORA-00904: "ADAMS": invalid identifier error
    With out Bind variables how Can I pass the Char type values in Dynamic SQL ?
    I would like to pass multipule values to p_county_code like 'Adams','Ashley' etc
    How Can I do this ?
    Thank for great help.
    Srini

    How do I write the Dynamic SQL for
    SELECT * FROM DW_COUNTY WHERE COUNTY_NAME LIKE 'Ad%'
    The usual way...
    hr@ORA10G>
    hr@ORA10G> var str varchar2(1000);
    hr@ORA10G> var cr refcursor;
    hr@ORA10G>
    hr@ORA10G> exec :str := 'select * from employees where first_name like ''A%''';
    PL/SQL procedure successfully completed.
    hr@ORA10G> -- note the escape character for each single quote
    hr@ORA10G> print str
    STR
    select * from employees where first_name like 'A%'
    hr@ORA10G>
    hr@ORA10G> exec open :cr for :str;
    PL/SQL procedure successfully completed.
    hr@ORA10G> print cr
    EMPLOYEE_ID FIRST_NAME           LAST_NAME                 EMAIL                     PHONE_NUMBER      HIRE_DATE JOB_ID    SALARY COMMISSION_PCT MANAGER_ID DEPARTMENT_ID
            103 Alexander            Hunold                    AHUNOLD                   590.423.4567         03-JAN-90 IT_PROG          9000                       102            60
            115 Alexander            Khoo                      AKHOO                     515.127.4562         18-MAY-95 PU_CLERK         3100                       114            30
            121 Adam                 Fripp                     AFRIPP                    650.123.2234         10-APR-97 ST_MAN           8200                       100            50
            147 Alberto              Errazuriz                 AERRAZUR                  011.44.1344.429278   10-MAR-97 SA_MAN          12000             .3        100            80
            158 Allan                McEwen                    AMCEWEN                   011.44.1345.829268   01-AUG-96 SA_REP           9000            .35        146            80
            167 Amit                 Banda                     ABANDA                    011.44.1346.729268   21-APR-00 SA_REP           6200             .1        147            80
            175 Alyssa               Hutton                    AHUTTON                   011.44.1644.429266   19-MAR-97 SA_REP           8800            .25        149            80
            185 Alexis               Bull                      ABULL                     650.509.2876         20-FEB-97 SH_CLERK         4100                       121            50
            187 Anthony              Cabrio                    ACABRIO                   650.509.4876         07-FEB-99 SH_CLERK         3000                       121            50
            196 Alana                Walsh                     AWALSH                    650.507.9811         24-APR-98 SH_CLERK         3100                       124            50
    10 rows selected.
    hr@ORA10G>
    hr@ORA10G>pratz

  • Multi-row sub query returns  ORA-00904 :invalid identifier error

    I am creating a report from two tables that I am not joining. I want a single line for every row in table1 that meets a date range. Table2 can contain none or many rows for each recored in table1. I want to get up to two fields from table2.
    I was using a case statement to check if there was data and then an in-line query or subquery. Once again, the idea is to have a single line on the report for each table1 record.
    I get this error with the code below. It seems the nested multi-row subquery can not see the a.cr_mas_cr_no identifier.
    ORA-00904: "a"."cr_mas_cr_no": invalid identifier
    Any help is greatly appreciated,
    Sam
    select
    a.cr_mas_cr_no "CRNO", a.cr_mas_type "TYPE", a.cr_mas_status "CR Status",
    a.cr_mas_date_logged "Logged date", a.CR_REL_REQ_APP_DATE "RTP approved",a.CR_REL_REQ_RTP_DATE "RTP Date",
    a.cr_accepted_date "Complete", a.cr_mas_submitted_by "Requester",
    select doc_user FROM crrm_cr_documents WHERE doc_cr_number =a.cr_mas_cr_no and rownum = 1 and DOC_TYPE = 'BD' ) "Bus Design",
    (select doc_user FROM crrm_cr_documents WHERE doc_cr_number = a.cr_mas_cr_no and rownum = 1 and DOC_TYPE = 'TD' ) "Tech Design",
    (select doc_user FROM crrm_cr_documents WHERE doc_cr_number = a.cr_mas_cr_no and rownum = 1 and DOC_TYPE = 'TE' ) "User acceptance test",
    case
    when (select count(appr_user) from crrm_cr_approvals where appr_cr_no = a.cr_mas_cr_no and appr_type = 'RTP') > 0
    then (select appr_user from (select * from crrm_cr_approvals where appr_cr_no = a.cr_mas_cr_no and appr_type = 'RTP') where rownum = 1)
    end
    "RTP #1",
    case
    when (select count(appr_user) from crrm_cr_approvals where appr_cr_no = a.cr_mas_cr_no and appr_type = 'RTP') > 1
    then (select appr_user from (select * from crrm_cr_approvals where appr_cr_no = a.cr_mas_cr_no and appr_type = 'RTP') where rownum = 2)
    end
    "RTP #2",
    a.CR_REL_REQ_RTP_BY "Released by",
    a.CR_ACCEPTED_BY "Post RTP User Acceptance",
    a.cr_mas_title "Title", a.cr_mas_id "ID"
    from
    crrm_crmaster a
    where
    (a.CR_REL_REQ_RTP_DATE >= :P1109_BEGDATE and (a.CR_REL_REQ_RTP_DATE <= :P1109_ENDDATE) and
    (a.cr_mas_status = 'Complete' or (a.cr_mas_status = 'Release Approved'and a.CR_REL_REQ_APP_DATE < :P1109_ENDDATE))
    Message was edited by:
    slavanaway

    Iceman,
    Thanks for the reply I will try your suggestion.
    I will try and explain why I think two subqueries (an in-line query with a subquery?) are required. I will use the creation of the column RTP #1 as the example as the RTP #2 column is only different in the rownum selected.
    Looking only at the lines that fail, here is my analysis. (If I rem out the two case lines the query runs, I just don't get two columns of data I need.) I will only examine the first case as the second is changed to extract the second approval via the rownum = 2 criteria. The first statement checks there is at least one RTP approval stored for the request and then gets the user who approved the request if the test is true.
    case when
    (select count(appr_user) from crrm_cr_approvals where appr_cr_no =a.cr_mas_cr_no and appr_type = 'RTP') > 0
    then
    The above part works fine and the correct count of approvals is returned.
    (select appr_user from (select * from crrm_cr_approvals where appr_cr_no=a.cr_mas_cr_no and appr_type = 'RTP') where rownum = 1)
    end
    "RTP #1",
    I moved the parenthesis to the correct location. There can be multiple approvals for a given parent record. Some parent records need one, some need two approvals. If I replace
    (select appr_user from (select * from crrm_cr_approvals where appr_cr_no =a.cr_mas_cr_no and appr_type = 'RTP') where rownum = 1)
    with
    (select appr_user from approvals where appr_cr_no =a.cr_mas_cr_no and appr_type = 'RTP' and rownum = 1)
    The correct result is returned because it returns exactly one row as rownum=1 limits the query. When rownum = 2 then the query returns null as the rownum never gets to two as the rownum column is built via the set created by the second subquery.
    The subquery builds a set of approvals for a specific "cr_no" and appr_type of "RTP". the outer query then looks at the rownum of the second query
    Here is where I got the rownum information from;
    http://www.oracle.com/technology/oramag/oracle/06-sep/o56asktom.html
    So here is what I think is happening;
    1. Main query From and Where are processed. This should provide the "set" for the query
    2.The from subqueries for RTP #1 and RTP #2 should be able to access the a.cr_mas_cr_no field and build a set from the approvals table.
    3.The RTP #1/2 subquery (inline maybe a better description?) would then get the correct row from the from subquery.
    The error "invalid identifier" refers to the a.cr_mas_cr_no field. I assume it means it can not resolve the table alias inside the subquery.
    So maybe your grouping would help, I will try.
    Sam

  • ORA-00904 invalid identifier error

    Here are the steps to reproduce this. My DB version is 9i R2.
    1) create table xmlsun1 of xmltype;
    2) create table xmlsun2 as select * from xmlsun1;
    Two Tables of XML Type created successfully
    3) insert into xmlsun1 values(xmltype('<employees><employee id="35"><FirstName>Tom</FirstName><LastName>Kyte</LastName></employee></employees>'));
    4) insert into xmlsun2 values(xmltype('<employees><employee id="35"><FirstName>Tom</FirstName><LastName>Kyte</LastName></employee></employees>'));
    Now when i query, i can see one record in each tables.
    The problem is only when updation.
    5) update xmlsun1 x
    set value(x) = updatexml(value(x),'/employees/employee/@id','37')
    where existsnode(value(x),'/employees/employee[FirstName = "Tom"]') = 1;
    1 row updated
    6) update xmlsun2 x
    set value(x) = updatexml(value(x),'/employees/employee/@id','37')
    where existsnode(value(x),'/employees/employee[FirstName = "Tom"]') = 1;
    This updation fails with the error : ORA-01775: looping chain of synonyms
    I tried to change alias of xmlsun2 to y
    update xmlsun2 y
    set value(y) = updatexml(value(y),'/employees/employee/@id','37')
    where existsnode(value(y),'/employees/employee[FirstName = "Tom"]') = 1;
    I get an error saying that Y is an invalid identifier. Now, how can i update the table xmlsun2? I can't use the alias x nor any other alias.
    Thanks,
    Sundar

    I've filed bug 5560960 for this behavoir, which is still not what you are describing.. Do you have SYNONYMS defined somewhere in your example ?
    $ sqlplus scott/tiger @testcase3
    SQL*Plus: Release 9.2.0.6.0 - Production on Fri Sep 22 11:59:46 2006
    Copyright (c) 1982, 2002, Oracle Corporation. All rights reserved.
    Connected to:
    Oracle9i Enterprise Edition Release 9.2.0.6.0 - Production
    With the Partitioning, OLAP and Oracle Data Mining options
    JServer Release 9.2.0.6.0 - Production
    SQL> drop table xmlsun1
    2 /
    Table dropped.
    SQL> create table xmlsun1 of xmltype
    2 /
    Table created.
    SQL> drop table xmlsun2
    2 /
    Table dropped.
    SQL> create table xmlsun2 as select * from xmlsun1
    2 /
    Table created.
    SQL> insert into xmlsun1 values( xmltype ('<employees><employee id="35"><FirstName>Tom</FirstName><LastName>Kyte</LastName></employee></employees>') )
    2 /
    1 row created.
    SQL> insert into xmlsun2 values( xmltype ('<employees><employee id="35"><FirstName>Tom</FirstName><LastName>Kyte</LastName></employee></employees>') )
    2 /
    1 row created.
    SQL> update xmlsun1 x
    2 set value(x) = updatexml(value(x),'/employees/employee/@id','37')
    3 where existsnode(value(x),'/employees/employee[FirstName = "Tom"]') = 1
    4 /
    1 row updated.
    SQL> update xmlsun2 x
    2 set value(x) = updatexml(value(x),'/employees/employee/@id','37')
    3 where existsnode(value(x),'/employees/employee[FirstName = "Tom"]') = 1
    4 /
    where existsnode(value(x),'/employees/employee[FirstName = "Tom"]') = 1
    ERROR at line 3:
    ORA-00904: "X": invalid identifier
    SQL> update xmlsun2 y
    2 set value(y) = updatexml(value(y),'/employees/employee/@id','37')
    3 where existsnode(value(y),'/employees/employee[FirstName = "Tom"]') = 1
    4 /
    where existsnode(value(y),'/employees/employee[FirstName = "Tom"]') = 1
    ERROR at line 3:
    ORA-00904: "Y": invalid identifier
    SQL>

  • Dynamic SQL Error -ORA-00904: invalid identifier

    Hello!
    I'm really hoping I can get some fast help on this. In the interest of honesty, this is for a university oracle programming assignment. I've searched everywhere I can for the answer and haven't had any luck.
    Anyway, the problem in a nutshell. I have to write a package to write a text file. The formatting information for the file is held in a table, which has columns to define the various characteristics like justification, padding character and field value.
    RECORDTYPE FIELDNAME FIELDVALUE FIELDSIZE FIELDORDER PADDINGCHAR JUSTIFICATION DATASOURCE
    7 CreditTotal v_credit 10 5 '0' LPAD PROGRAM
    7 RecordType '7' 1 1 ' ' RPAD HARDCODE
    I can build the whole file except this footer. the FieldValue "v_credit" references a variable that has the calculated total of the credit amounts for the file. There are also "v_debit", and "(v_credit-v_debt)" entries.
    My question seems simple... How can I use this VARCHAR2 value from the table, and have it reference the variable within a Dynamic SQL string? If I use the textvalue of the column in the SQL string it gives me the invalid identifier error when it hits the EXECUTE IMMEDIATE statement. There is another row for the header which has "to_char(sysdate,'DDMMYYYY')" in it, and that runs fine. I'm assuming because they are native SQL statements and variables.
    I have tried encapsulating the v_credit in "s, and using dynamica bind variables but had the same problem passing the names to the USING clause.
    The SQL string created by the procedure is: SELECT LPAD(v_credit,10,'0' ) FROM dual
    The full error is:
    ORA-00904: "V_CREDIT": invalid identifier
    ORA-06512: at "BWOOD.PKG_BRIAN", line 108
    ORA-06512: at line 2
    Line 108 is the EXECUTE IMMEDIATE statement
    I would really appreciate someones help! I'm happy to post the procedure I've written, with the caveat that it's sloppy student work and needs cleaning up of all the experimental commented attempts:)
    Edited by: user5426606 on 20-May-2009 03:34 - Added a few more facts.

    Thank you for the fast replies. I'll post a short chunk of code to demonstrate.
    The actual procedure is quite a bit longer, but this should give you the idea.
    PROCEDURE build_dbfile (p_settlement_date IN DATE, p_settlement_key IN VARCHAR2, p_type IN VARCHAR2) AS
    v_sqlString    VARCHAR2(4000) := 'SELECT ';
    v_rectype     NUMBER := 7;
    v_line           LONG;
    v_debit        NUMBER := 0;
    v_credit       NUMBER := 0;
    v_nrRecords    NUMBER := 0;
      CURSOR c_settlement IS... -- to select records for data rows
    -- cursor to select the rows with the file formatting and data info
      CURSOR c_header IS   SELECT   NVL(fieldvalue,fieldname) db_field, <---- selects the data column
                                                   fieldsize,
                                                   NVL(paddingchar, ''' ''') paddingchar,
                                                   NVL(justification,'LPAD') justification,
                                                  datasource
                                      FROM     FSS_DESKBANK_REF
                                      WHERE    recordtype = r_rec_types.recordtype
                                      ORDER BY recordType, fieldorder;
    -- SELECT to get the SUM of datarows for v_credit
      SELECT      SUM(transactionamount)
      INTO      v_credit...
    -- SELECT to get the SUM of datarows for v_debit
      SELECT      SUM(transactionamount)
      INTO      v_debit....
    FOR r_head IN c_header LOOP
    v_sqlString := v_sqlString  || r_head.justification|| '('
                                         || r_head.db_field ||','
                                         || r_head.fieldsize || ','
                                         || r_head.paddingchar || ')';
    v_sqlString := v_sqlString || ' FROM ' || v_tbl_name;
    DBMS_OUTPUT.PUT_LINE('SQL --> '||v_sqlString);
    EXECUTE IMMEDIATE v_sqlString INTO v_line;
    END LOOP;
    DBMS_OUTPUT.PUT_LINE(v_line);
    END build_dbfile;So the loop goes through the table rows, grabs each data value and formatting column, and builds the sql string, which is then passed to the execute statement. The issue is the ones where the datarow contains a reference to v_credit, and the error is generated. ie r_head.db_field contains the string "v_credit"
    Satish, the sql does look like that in the string, but the string is built from the table, not hardcoded. ie v_sqlString = "SELECT LPAD(v_credit,10,'0' ) FROM dual" when it is passed to the EXECUTE IMMEDIATE.
    Edited by: user5426606 on 20-May-2009 05:19

  • ORA-00904 - invalid identifier when adding new column to the report query

    Hi,
    I am trying to add a new field to an existing bespoke report query. When I click on ok, I get the following error
    message: "ORA-00904: <field name> : invalid identifier ==> <field_name>
    Any ideas what is causing this problem? Version of the report builder is : 6.0.8 and is connected to a 10.2 db.
    Any help appreciated.
    Many Thanks,
    Praveen
    Edited by: praveenrn on May 21, 2009 2:38 PM

    What is the field name ? Maybe a reserved word ? Change to "my_new_variable" to check...
    Cheers,
    Jens Rettig

  • OIM 11g R1 ORA-00904 invalid identifier

    Hello,
    When I try to create a "Create User" Request, I got this Error:
    <Feb 7, 2013 4:50:28 PM COT> <Error> <oracle.iam.oimdataproviders.impl> <BEA-000000> <ORA-00904: "USR"."USR_UDF_ES_USUARIO_RPT_S_N": invalid identifier
    java.sql.SQLSyntaxErrorException: ORA-00904: "USR"."USR_UDF_ES_USUARIO_RPT_S_N": invalid identifier
    at oracle.jdbc.driver.T4CTTIoer.processError(T4CTTIoer.java:457)
    at oracle.jdbc.driver.T4CTTIoer.processError(T4CTTIoer.java:405)
    at oracle.jdbc.driver.T4C8Oall.processError(T4C8Oall.java:889)
    at oracle.jdbc.driver.T4CTTIfun.receive(T4CTTIfun.java:476)
    at oracle.jdbc.driver.T4CTTIfun.doRPC(T4CTTIfun.java:204)
    And I use any of the templates for create the request but OIM Log shows the same error.
    And the request is not created successfully.
    Please, help!
    Thanks

    Did you create this field "USR_UDF_ES_USUARIO_RPT_S_N" ?
    Go to USR table also verify this column. Does it exist ?

  • Oracle GateWay ORA-00904:  invalid identifier - How Fixed it

    Database: 11.2.0 Windows 32-bit (on WindowsXP SP3)
    ORACLE_HOME = D:\Oracle\Product\11.2.0\dbhome
    GATEWAY_HOME = D:\Oracle\Product\11.2.0\gw
    odbc : sqlserver (working... i can import table's data in MS Excel) its ok...
    odbc : dg4msql (working... i can import table's data in MS Excel) its ok...
    Oracle GateWay Listener
    D:\Oracle\Product\11.2.0\gw\NETWORK\ADMIN
    # listener.ora Network Configuration File: D:\Oracle\Product\11.2.0\gw\network\admin\listener.ora
    # Generated by Oracle configuration tools.
    SID_LIST_GWLISTENER =
    (SID_LIST =
    (SID_DESC =
    (SID_NAME = dg4msql)
    (ORACLE_HOME = D:\Oracle\Product\11.2.0\gw)
    (ENVS = "EXTPROC_DLLS=ONLY:D:\Oracle\Product\11.2.0\gw\bin\oraclr11.dll")
    (PROGRAM = dg4msql)
    (SID_DESC=
    (SID_NAME=dg4msql)
    (ORACLE_HOME = D:\Oracle\Product\11.2.0\gw)
    (PROGRAM = dg4msql)
    GWLISTENER =
    (DESCRIPTION_LIST =
    (DESCRIPTION =
    (ADDRESS = (PROTOCOL = IPC)(KEY = EXTPROC1522))
    (ADDRESS = (PROTOCOL = TCP)(HOST = 192.168.0.90)(PORT = 1522))
    ADR_BASE_GWLISTENER = D:\Oracle\Product\11.2.0\gw
    Gateway Listener Status
    LSNRCTL> status GWLISTENER
    Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=IPC)(KEY=EXTPROC1522)))
    STATUS of the LISTENER
    Alias GWLISTENER
    Version TNSLSNR for 32-bit Windows: Version 11.2.0.1.0 - Produ
    ction
    Start Date 13-OCT-2011 11:36:16
    Uptime 0 days 0 hr. 29 min. 43 sec
    Trace Level off
    Security ON: Local OS Authentication
    SNMP OFF
    Listener Parameter File D:\Oracle\Product\11.2.0\gw\network\admin\listener.ora
    Listener Log File d:\oracle\product\11.2.0\gw\diag\tnslsnr\appsdba\gwlis
    tener\alert\log.xml
    Listening Endpoints Summary...
    (DESCRIPTION=(ADDRESS=(PROTOCOL=ipc)(PIPENAME=\\.\pipe\EXTPROC1522ipc)))
    (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=192.168.0.90)(PORT=1522)))
    Services Summary...
    Service "dg4msql" has 1 instance(s).
    Instance "dg4msql", status UNKNOWN, has 2 handler(s) for this service...
    The command completed successfully
    LSNRCTL>
    D:\Oracle\Product\11.2.0\gw\network\admin\sqlnet.ora
    # sqlnet.ora Network Configuration File: D:\Oracle\Product\11.2.0\gw\network\admin\sqlnet.ora
    # Generated by Oracle configuration tools.
    # This file is actually generated by netca. But if customers choose to
    # install "Software Only", this file wont exist and without the native
    # authentication, they will not be able to connect to the database on NT.
    SQLNET.AUTHENTICATION_SERVICES= (NTS)
    NAMES.DIRECTORY_PATH= (TNSNAMES, EZCONNECT)
    D:\Oracle\Product\11.2.0\gw\dg4msql\admin\initdg4msql.ora
    # This is a customized agent init file that contains the HS parameters
    # that are needed for the Database Gateway for Microsoft SQL Server
    # HS init parameters
    #HS_FDS_CONNECT_INFO=[192.168.0.8]/SRV-TULIP/WZHRM
    HS_FDS_CONNECT_INFO=192.168.0.8,1433//wzhrm
    HS_FDS_TRACE_LEVEL=OFF
    HS_FDS_RECOVERY_ACCOUNT=RECOVER
    HS_FDS_RECOVERY_PWD=RECOVER
    D:\Oracle\Product\11.2.0\dbhome\NETWORK\ADMIN\tnsnames.ora
    ORCL =
    (DESCRIPTION =
    (ADDRESS = (PROTOCOL = TCP)(HOST = 192.168.0.90)(PORT = 1521))
    (CONNECT_DATA =
    (SERVER = DEDICATED)
    (SERVICE_NAME = orcl)
    PROD=
    (DESCRIPTION=
    (ADDRESS=(PROTOCOL=tcp)(HOST=192.168.0.230)(PORT=1521))
    (CONNECT_DATA=(SID=PROD))
    sqlserver =
    (DESCRIPTION=
         (ADDRESS=(PROTOCOL=tcp)(HOST=192.168.0.90)(PORT=1521))
    (CONNECT_DATA =
    (SID=sqlserver))
    (HS = OK)
    dg4msql =
    (DESCRIPTION=
    (ADDRESS=(PROTOCOL=tcp)(HOST=192.168.0.90)(PORT=1522))
    (CONNECT_DATA=(SID=dg4msql))
    (HS=OK)
    Database Link
    create database link dg4msql connect to usroracle identified by usroracle using 'dg4msql';
    1* select from rvwHLoanApp@dg4msql*
    SQL> /
    empId description
    0001 Mr. Ali Jawad
    0002 Mr. Imran Farooq
    0003 Mr. Ali Ejaz
    0004 Mr. Mujahid Muhammad
    0005 Mr. Sharjeel Malik
    0006 Mr. Kashif Imran
    0009 Mr. Adeel Sadiq
    empId description
    0010 Mr. Hafiz Muhammad Bilal
    0012 Mr. Asif Ahmad Arif
    0018 Mr. Muhammad Akram
    0019 Mr. Aftab Hussain
    0020 Mr. Ehtisham Maqsood Attari
    0022 Mr. Adnan Raza Saleem
    0023 Mr. Badar-Uz- Zaman
    15 rows selected.
    When try for selected clumns its showing some error. Where is problem
    SQL> select empId from rvwHLoanApp@dg4msql;
    select empId from rvwHLoanApp@dg4msql
    ERROR at line 1:
    ORA-00904: "EMPID": invalid identifier
    SQL> select empId,description from rvwHLoanApp@dg4msql;
    select empId,description from rvwHLoanApp@dg4msql
    ERROR at line 1:
    ORA-00904: "DESCRIPTION": invalid identifier
    SQL>
    SQL>
    Waiting for help. What thing im missing.....

    Naeem,
    There is no setting that would allow you to drop the double quotes round the object names as the translation to upper case is made by the Oracle database.
    The only solution would be to create views in Oracle that translate the names to upper case, for example -
    CREATE VIEW EMP (EMPNO, ENAME, SAL, HIREDATE)
    AS SELECT "empno", "ename", "sal", "hiredate"
    FROM "emp"@DG4MSQL;
    and then select from the view -
    SELECT EMPNO, ENAME FROM EMP;
    This is discussed in the documentation -
    Oracle® Database Gateway for SQL Server User’s Guide, 11g Release 2 (11.2)
    in the section -
    SQL Server Gateway Features and Restriction
    - Case Sensitivity
    Regards,
    Mike

  • ORA-00904 invalid identifier in 10.2.0.4.0

    Hi
    SELECT a1.dummy,
    (SELECT a2.dummy FROM
    (SELECT dummy FROM dual a3 WHERE a1.dummy=a3.dummy
    ) a2
    FROM dual a1;
    The above query runs well in Oracle Database 10g Enterprise Edition Release 10.2.0.1.0 - Prod.
    But the same query throwing error ORA-00904: "A1"."DUMMY": invalid identifier in Oracle Database 10g Release 10.2.0.4.0 - 64bit Production.
    Pls help...
    Thanks & Regards
    S.Kumar

    Well, it's actually the other way around:
    The bug is in version 10.2.0.1 and it got fixed in version 10.2.0.4
    Did you read the links i posted?
    Quote from the second link:
    "the first one fails because we tried to push the dual.dummy reference two levels down - *in correlated subqueries, they only go a level*."

Maybe you are looking for

  • SCOM services password required to retype everytime restart the services

    Hi, Everytime i restart the server center configuration service and system center data access service. It will failed to restart and prompt out password error message. I need to retype the same password and hit Apply then it will prompted with a dial

  • Skype for Business issue

    After installing Skype for Business Preview everything seemed to work perfectly. After restarting the PC again the new interface didn't load again and the old Lync 2013 interface appeared but with the new skype icon and the new emoticons. How can I g

  • Conditional Validation using Spry

    When are we going to see things like conditional validations in DW using spry? I am by no means a developer and enjoy using DW for its simplicity but I have a situation at the moment wherby I need to make a text box required if a checkbox group or ra

  • Inventory Reporting Query

    I have implemented Inventory management via standard cube 0IC_C03 and on my stock overview query i'm getting some value in square brackets i.e. [$39,200.00]. Can anyone explain to me what does this means. thank you in advance

  • Photoshop: full screen mode shortcut not working

    photoshop: full screen mode shortcut not working, if i press shirt+alt+ctr key then i delete the file, what happen ?