Problem with ORA --0094 : Invalid identifier

Hi All,
I am facing an issue while executing a query in the Oracle 11g R2 database.
Let us take an example.
create table test (ID int not null, country_Name Varchar(20))
if i do select * from test where country_Name="someValue". It gives ORA- 0094 error and says "someValue" is invalid identifier.
whereas if i do "select * from test where country_Name='someValue'. It works fine.
Can somebody help me out. This is very urgent

user11264408 wrote:
Hi All,
I am facing an issue while executing a query in the Oracle 11g R2 database.
Let us take an example.
create table test (ID int not null, country_Name Varchar(20))
if i do select * from test where country_Name="someValue". It gives ORA- 0094 error and says "someValue" is invalid identifier.
whereas if i do "select * from test where country_Name='someValue'. It works fine.
Can somebody help me out. This is very urgentit is working as expected & desired.
when double quote marks enclose a string, Oracle expect it to be a valid Oracle Object.
what additional help do you expect & desire?

Similar Messages

  • Problem with ORA-24372 invalid object for describe

    I have unresolved problem with oracle message: ORA-24372 invalid object for describe. There is the client-server application which installed on users PCs. Client application is program on Delphi 7 that installed on several users PCs which works with Oracle DB 10g server (clients on users side 8.1.7) by means ODAC 5.7. Each user by means this application works with data on Oracle server. Each group of users uses its own schema. Each of this schema has grants to select data and execute procs in the main schema. During the time of operation I modified and compiled some procs in the main schema. As the result I found some depended Invalid objects in main schema. I recompiled them. There is no invalid objects in all schemas. But when I starts application in one user place (he uses for example schema X1) I see oracle message: ORA-24372 invalid object for describe. Other users in group which uses schema X1 works without this problem. There is finite aggregate of users of schema Х1 which has this message but some users of schema Х1 has no problem. All users has identical software and there is no any invalid objects in schemas! I try to start application on my PC using schema X1 and finds ORA-24372 then I try to start application on neighbors PC and it is all ok! It happened after I recompiled main schema in the time of users operation. What should I do to resolve this problem? Where to find the source of the problem: in client or in server?

    To Mr. Sven Weller
    The purpose of creation X1 (X2, Х3…) was restriction of users to access objects in the Main Schema. X1 has no any objects except function that returns her name for internal purposes. X1 has many synonyms for objects in the Main schema. There is no invalid objects in X1!

  • 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

  • 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

  • Local Domain Index  query fails with ora-01410: invalid rowid

    Hello!
    I have a task to implement partitioned domain index for range partitioned table.
    As I understood from reference http://download.oracle.com/docs/cd/B28359_01/appdev.111/b28425/dom_idx.htm
    the main difference is to provide support for partitioning operations by
    implementing corresponding ODCI interface functions.
    For the first I decided to create something simple to not spend time on system partitioned
    index storage table. My problem is that domain index works correctly when it's created without
    support for partitioning and produces "*ORA-01410: INVALID ROWID*" when it's created
    with LOCAL option.
    Test query:
    SELECT /* +index(from_sample_index) */ * FROM index_in_partitioned_tbl WHERE position_between(card_no)  < 50 ORDER BY card_no DESC;
    Index creared in this way returns 3 rows:
    CREATE INDEX from_sample_index ON index_in_partitioned_tbl (card_no) INDEXTYPE IS position_indextype;
    When index has been creared with LOCAL option I got "ORA-01410: INVALID ROWID" :
    CREATE INDEX from_sample_index ON index_in_partitioned_tbl (card_no) INDEXTYPE IS position_indextype LOCAL;
    I don't post implementation's source code to reduce amount of text in post. It works for global index.
    If I copy rowid from index storage table and then put it into something like
    SELECT card_no FROM index_in_partitioned_tbl WHERE rowid = 'AAAXHGAAEAAAFERAAh';
    then it will be executed successfully without any errors.
    I suppose the error could be somehow linked with "alter index" calls that Oracle makes when local domain index is created.
    The calls are made with option "AlterIndexRebuild" - possibly they mark index as invalid (though it's shown as valid in SQL Developer)

    Solved :)
    when index is LOCAL calls for ODCIINDEXSTART - ODCIINDEXFETCH - ODCIINDEXCLOSE are executed for each partition of base table.
    In my case ODCIINDEXFETCH returns row_id's regardless of partition that are currently scanned for values. So first call returned rowid values for all partitions not only for the first partition and validation failed with "ora-01410: invalid rowid"

  • 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

  • Custom Interface Program Errors out with ORA-01722: invalid number in R12

    Hi,
    We were upgrading to R12 in which our custom interface load program errors out with "ORA-01722: invalid number". Please find structure of control file as below :
    LOAD DATA
    APPEND
    INTO TABLE RRAT_RCAP_GIO_MAN_ADJ_STG
    FIELDS TERMINATED BY ',' OPTIONALLY ENCLOSED by '"'
    TRAILING NULLCOLS
    PERIOD_NAME CHAR "ltrim(rtrim(:PERIOD_NAME))"
    ,SOURCE_TYPE CHAR "ltrim(rtrim(:SOURCE_TYPE))"
    ,ADJ_ACCOUNT CHAR "ltrim(rtrim(:ADJ_ACCOUNT))"
    ,USD_NET                    INTEGER EXTERNAL
    ,ERROR_CODE CONSTANT 'LOADED DATA'
    ,PROCESS_FLAG CONSTANT 1
    ,CREATED_BY "fnd_global.user_id"
    ,CREATION_DATE sysdate
    ,LAST_UPDATED_BY "fnd_global.user_id"
    ,LAST_UPDATE_DATE sysdate
    ,LAST_UPDATE_LOGIN "fnd_global.login_id"
    ,REQUEST_ID "fnd_global.conc_request_id"
    =====================================Log file ================
    Record 1: Rejected - Error on table "XXATORCL"."XXAT_VCAP_GIO_MAN_ADJ_STG", column USD_NET.
    ORA-01722: invalid number
    ===================sample file ==========================
    JUL-11,Manual,8213-880011-00000000-259390-1Z-0000-0000,1001
    JUL-11,Manual,8213-880011-00000000-253701-1Z-0000-0000,73
    ==========================================
    I had tried with last successfully uploaded file as well which is also now not uploading.
    Please help me in this issue.
    Thanks,
    Piyush

    i am using R12 now. Please avoide INTEGER EXTERNAL part from the control file. please refer below :
    LOAD DATA
    APPEND
    INTO TABLE RRAT_RCAP_GIO_MAN_ADJ_STG
    FIELDS TERMINATED BY ',' OPTIONALLY ENCLOSED by '"'
    TRAILING NULLCOLS
    PERIOD_NAME CHAR "ltrim(rtrim(:PERIOD_NAME))"
    ,SOURCE_TYPE CHAR "ltrim(rtrim(:SOURCE_TYPE))"
    ,ADJ_ACCOUNT CHAR "ltrim(rtrim(:ADJ_ACCOUNT))"
    ,USD_NET
    ,ERROR_CODE CONSTANT 'LOADED DATA'
    ,PROCESS_FLAG CONSTANT 1
    ,CREATED_BY "fnd_global.user_id"
    ,CREATION_DATE sysdate
    ,LAST_UPDATED_BY "fnd_global.user_id"
    ,LAST_UPDATE_DATE sysdate
    ,LAST_UPDATE_LOGIN "fnd_global.login_id"
    ,REQUEST_ID "fnd_global.conc_request_id"
    ====================
    Srini,
    Just one thing i want to explain you that previously it was working fine but suddenly (might after upgrading in R12) started giving error. I had tested with old data files also which were loaded successfully in the system. but now it is giving error. Please help me in this issue.
    Regards,

  • 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

  • Problem with ora-28000 error

    Hi all,
    I got a problem with ORA-28000 in my form. In my app, it allows user to try maximum 3 time to logon, if the user fails, his/her user will be locked. The problem is, when Oracle locked that user, in on-error trigger I cannot catch that error and show the error message.
    Anybody, please give me a hand.
    Thank alot

    I put code (in the on-error trigger) here. please have look, thanks again.
    IN_ERR_CODE NUMBER := ERROR_CODE;
    BEGIN
         IF(IN_ERR_CODE = 28001) THEN
         ELSIF (IN_ERR_CODE = 28002) THEN
         ELSIF (IN_ERR_CODE = 28011) THEN
         ELSIF (IN_ERR_CODE = 28000) THEN
              MESSAGE(ERROR_TEXT);
              --LEAVE_FORM;
              --clear_form(no_validate);
              --RAISE FORM_TRIGGER_FAILURE;
              --EXIT_FORM(NO_VALIDATE);
         END IF;
    END;

  • Problem with ORA-25240 and msgId:=NULL

    Hi,
    I have a problem with ORA-25240- the documentation says that you cannot specify a message ID and correlation ID int the dequeue- options. However I am getting it setting msgid explicitely to NULL!
    The code snippet is:
    vr_message jms_message_with_header_type;
    vr_dequeue_options DBMS_AQ.dequeue_options_t;
    v_message_handle RAW(16);
    BEGIN
    vr_dequeue_options.deq_condition := 'tab.user_data.header.properties IS NOT NULL AND '
    || 'tab.user_data.get_string_property('MYServicename'') = '''
    || i_MY_Servicename || '''';
    vr_dequeue_options.correlation := i_correlation;
    vr_dequeue_options.navigation := DBMS_AQ.FIRST_MESSAGE;
    -- should be default anyway:
    vr_dequeue_options.msgid:=NULL;
    vr_dequeue_options.wait := DBMS_AQ.NO_WAIT;
    DBMS_AQ.DEQUEUE
    queue_name => 'MYQUEUE',
    dequeue_options => vr_dequeue_options,
    message_properties => vr_message.header,
    payload => vr_message.message,
    msgid => v_message_handle
    Any ideas?
    Thank you,
    Steffen

    Hi,
    the version is:
    SQL> select * from v$version;
    BANNER
    Oracle Database 10g Enterprise Edition Release 10.2.0.3.0 - 64bi
    PL/SQL Release 10.2.0.3.0 - Production
    CORE 10.2.0.3.0 Production
    TNS for HPUX: Version 10.2.0.3.0 - Production
    NLSRTL Version 10.2.0.3.0 - Production
    SQL>
    The example behind the link is not complex enough. They are not using deq_condition and correlationId of the deque- options. If I set one of these values to NULL the code works fine but it complains about msgId if I have both values set with msgId=NULL?!?
    Thanks,
    Steffen

  • Item Validation on a Form - Receives ORA-0094: Invalid Idenitier error

    I'm fairly new to APEX and having an issue with an Item Validation on a Form receiving the ORA-0094: <Column Name>: Invalid Identifier error. I have looked at postings in this form on this error and tried many of the suggestions. I still can not get it to work. My lack of experience with APEX is not helping either.
    I'm using APEX release 2.2 with IE6.
    I'm trying to create a new Invoice in the Invoice table (CTS_INVOICE). The RFA Number for this invoice must be an active RFA record in the RFA table (CTS_RFA). Before I add the check for the RFA active status, I wanted to get the code that checks for the existence of the RFA record working first.
    After filling in the fields on the forms, click the Create button, and receives an error page with the following error ORA-0094: "RFA_NUMBER": Invalid Identifier.
    I have checked to make sure the table name, column name, and item name were correct with spelling and capitalization.
    Used the Wizard to setup the Item Validation.
    Type: EXISTS
    Validation Expression 1: Select 1 from CTS_RFA where RFA_Number = :P25_RFA_NUMBER
    Error message: Enter an active RFA number.
    location: Inline with Field and in Notification
    Associated Item: P25_RFA_NUMBER
    Any help would be greatly appreciated.
    Thanks,
    Vivian

    Vivian - Might the column have been created as a quoted identifier with mixed upper/lower case characters?
    Run this in SQL*Plus:
    select count(rfa_number) from cts_rfa;
    If that works without error then this is not the problem.
    Scott

  • 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

  • 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

Maybe you are looking for

  • No shared memory

    hi in BW PRD while executing a report we are getting an error error  message  " AN EXCEPTION WITH TYPE CX_SY_EXPORT_NO_SHARED_MEMORY  OCCURED, NO  SPACE  LEFT IN SHARED MEMORY" Edited by: sarat chandra bomma reddy on Apr 1, 2008 8:45 AM

  • Leopard Will Not Install On My G5

    When I insert the CD and run the install for Leopard 10.5. I get the message to restart my computer to start the install. However, the computer just restarts like every other time and no installation menu pops up either during boot up or after. What

  • Calling stored java-procedure in Oracle9i Lite from ODBC

    I've got a problem: I try to call a stored java-procedure through ODBC. The stored java-procedure in Oracle 9i Lite is called successfully from server console (MSQL). When I call my stored java-procedure from my web-application (ASP) through ODBC con

  • Leaving Printer Turned-On

    My Epson printer just failed and I have recycled it. I customarily left it turned on 24/7 (unless I was going to be away for an extended time). I have just added a HP Photosmart Premium C310 Series. My question is what is the best practice with this

  • Group messaging....ugh!!

    First let me start off by saying my group messaging is ON. However, when I reply to a group text the group does not see it, it only goes to individuals. When I get a group text, it only shows up as MMS message (so I know it's a group) but it shows up