Getting ora:00904 invalid indentifier error while running i query

Hi,
I have a remote database and local database both are oracle 10gR2.Now i have written the below mentioned query in my local database and is working fine,but in case remote database it is throughing error ora:00904 invalid indentifier.
I had export the dump from remote db and import it on my local db and i tried the same and it is working fine on local after that also.
As i believe that this error usually come for column name not exist or column name or it's length or for any special character in column name of the table.But as i said it is working fine on local db but not in remote db though i am using the same dump for local and remote.
Though when i am querying the table i can able to fetch data for the any record but when i am using the below mentioned query for the same i am getting the error.As i am doing this to fecth the data for child parent related relationship.
Can any one suggest is there anything related to configaration or something else.
Please do let me know if you do want some more information on the query what i am doing inside of it.
Rgds,
Anit
Edited by: Anit A. on Sep 1, 2008 2:32 AM
Edited by: Anit A. on Sep 1, 2008 2:33 AM

WITH t
AS
SELECT decode(t.spnlevel
,3,t.u_quotesdtlid
,2,decode((select count(*)
from u_quotesdtl t2
where t2.u_quotesdtlid = t.u_quotesdtlid
and t2.parentspn = (t2.jobgroupid||':'||t2.jobtype)
),0,(select t1.u_quotesdtlid
from u_quotesdtl t1
where t1.spnitemcode = t.parentspn
and t1.spnlevel = '3'
and t1.jobtype = t.jobtype
and t1.jobgroupid = t.jobgroupid
and t1.QUOTEID = t.QUOTEID
),t.u_quotesdtlid
,1,decode((select count(*)
from u_quotesdtl t2
where t2.QUOTEID = t.QUOTEID
and t2.parentspn = (t2.jobgroupid||':'||t2.jobtype)
),0,t.u_quotesdtlid,decode((select count(*)
from u_quotesdtl t3
where t3.QUOTEID = t.QUOTEID
and t3.parentspn = (t3.jobgroupid||':'||t3.jobtype)
and t3.u_quotesdtlid in (select t1.u_quotesdtlid
from u_quotesdtl t1
where t1.spnitemcode = t.parentspn
and t1.spnlevel = '2'
and t1.jobtype = t.jobtype
and t1.jobgroupid = t.jobgroupid
and t1.QUOTEID = t.QUOTEID
),0,(select t4.u_quotesdtlid
from u_quotesdtl t4
,(select t1.parentspn
,t1.jobtype
,t1.jobgroupid
from u_quotesdtl t1
where t1.spnitemcode = t.parentspn
and t1.spnlevel = '2'
and t1.jobtype = t.jobtype
and t1.jobgroupid = t.jobgroupid
and t1.QUOTEID = t.QUOTEID
) t5
where t4.spnitemcode = t5.parentspn
and t4.spnlevel = '3'
and t4.jobtype = t5.jobtype
and t4.jobgroupid = t5.jobgroupid
and t4.QUOTEID = t.QUOTEID
(select t1.u_quotesdtlid
from u_quotesdtl t1
where t1.spnitemcode = t.parentspn
and t1.spnlevel = '2'
and t1.jobtype = t.jobtype
and t1.jobgroupid = t.jobgroupid
and t1.QUOTEID = t.QUOTEID
,null,t.u_quotesdtlid) as parentquoteid
,t.u_quotesdtlid as quotesdtlid
,t.spnlevel as spnlevel
FROM u_quotesdtl t
WHERE t.QUOTEID ='som key id'
ORDER BY parentquoteid,t.spnlevel desc
select * from t;

Similar Messages

  • 'ORA-01722: Invalid Number' error while Running a Query

    Hi,
    I'm trying to run a query built on a DSO. The DSO has a field 'Start Date'. This Start Date InfoObject has a reference Char as 0DATE.
    This Start Field has blank values due to which I'm getting the ORA-01722 error. I came across many threads with same topic of discussion. As mentioned in one of the Threads I have written a program to update 'Start Date' with 00000000. The code wriiten is "UPDATE /BIC/AZ_MONINV00 SET /BIC/ZSTR_DTE = '00000000' where /BIC/ZSTR_DTE = ' '.
    Now when I see the data in the active data table of DSO the blank value is replaced with '00000000'.
    But If I right click on the DSO click on display data the 'Start Date' field is blank. And now the Query also gets executed without any error. But in the output of the query the 'Start Date' Field has "#" values.
    Can anyone suggest on how can I make these "#" values appear as 00000000 in the report?

    In this case, you have to write a macro to avoid # in Analyzer.
    Right Click-->Display Data will show data from Active table of DSO only.
    If you don't want to show any blank date values in the report, you can exclude in Filter in Query.

  • 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

  • Recieving ORA-01722 invalid number error while creating a materialized view

    Hi,
    I am receiving a ORA-01722 invalid number error while creating a materialized view. when run the select statement of the view i don't get any error, but when i use the same select statement to create a materialized view i receive this error. Could any please help in resolving this error. Here is the code i am using to create a materialized view.
    CREATE MATERIALIZED VIEW MV_EBS_CH_CLOSED
    REFRESH FORCE ON DEMAND
    AS
    SELECT DISTINCT kr.request_id, org.org_unit_name,
    ebs_ch_ticket_type (kr.request_id) ticket_type,
    DECODE
    (kr.status_code,
    'CLOSED_SUCCESS', kr.last_update_date,
    'IN_PROGRESS', (SELECT MAX (start_time)
    FROM ebs_ch_datastore ecd1
    WHERE kr.request_id = ecd1.request_id
    AND workflow_step_name =
    'Final BA Review and Deployment Exit Criteria')
    ) closed_date,
    substr(krhd.visible_parameter12,1,10) siebel_start_date,
    kr.creation_date itg_start_date
    FROM kcrt_requests kr,
    kcrt_request_types krt,
    kcrt_req_header_details krhd, kcrt_request_details krd1,
    (SELECT koum.user_id user_id,
    DECODE (koup.org_unit_name,
    'IT Implementations', 'CHS - Service Management BA',
    koup.org_unit_name
    ) org_unit_name
    FROM krsc_org_unit_members koum, krsc_org_units koup
    WHERE 1 = 1
    AND 'Y' = koup.enabled_flag
    AND koum.org_unit_id = koup.org_unit_id
    AND EXISTS (
    SELECT 'X'
    FROM krsc_org_units kouc
    WHERE koup.org_unit_id = kouc.org_unit_id
    START WITH kouc.parent_org_unit_id =
    ANY (SELECT org_unit_id
    FROM krsc_org_units krsc_org_units1
    WHERE 'Clearinghouse' =
    org_unit_name)
    CONNECT BY kouc.parent_org_unit_id =
    PRIOR kouc.org_unit_id)
    UNION
    SELECT kou.manager_id user_id,
    DECODE
    (kou.org_unit_name,
    'IT Implementations', 'CHS - Service Management BA',
    kou.org_unit_name
    ) org_unit_name
    FROM krsc_org_units kou
    WHERE 'Y' = kou.enabled_flag
    START WITH kou.parent_org_unit_id =
    (SELECT org_unit_id
    FROM krsc_org_units krsc_org_units2
    WHERE 'Clearinghouse' = org_unit_name)
    CONNECT BY kou.parent_org_unit_id = PRIOR kou.org_unit_id) org
    WHERE krt.request_type_id = kr.request_type_id
    AND krt.request_type_name IN ('Bug Fix', 'IT Enhancement')
    and kr.REQUEST_ID = krd1.request_id
    and krd1.batch_number = 1
    AND kr.request_id = krhd.request_id
    AND org.user_id in (krd1.parameter4, krd1.parameter5, krd1.parameter7)
    AND ( 'CLOSED_SUCCESS' = kr.status_code
    OR 'IN_PROGRESS' = kr.status_code
    AND kr.request_id IN (
    SELECT request_id
    FROM (SELECT DISTINCT request_id,
    MAX
    (start_time)
    closed_date
    FROM ebs_ch_datastore
    WHERE 'Final BA Review and Deployment Exit Criteria' =
    workflow_step_name
    GROUP BY request_id))
    Thanks,
    Shaik Mohiuddin

    This error occurs when you try to create a materialized view , but if you run the sql the results are perfectly fine. Well it happend to me also and to fix this I made sure all the coulmns have the same data type which are used in joins or in where clause.
    use
    where
    to_number(col1)=to_number(col2) and to_number(col3)=to_number(col4)
    hope this helps..

  • Nested table update gets ORA-00904 with ExecuteSQL, error-free in TOAD

    I'm trying to run an UPDATE query through the ExecuteSQL method
    of the oraDatabase object. The catch seems to be that this one
    affects a nested table (field to be updated is a table itself).
    This SQL runs perfectly in T.O.A.D. ...
    UPDATE B457.AIRLINE a SET
    a.rental_cust_code=B457.RENTCUSTCODELIST(rentcustcodes
    ('45645'),rentcustcodes('1234'),rentcustcodes('234234')) WHERE
    a.AIRLINE_CODE='RCR'
    ...but, it produces the "SQL execution error, ORA-00904: invalid
    column name" when run using ExecuteSQL.
    Do I need to use a different syntax?

    and the complete example
    SQL> create or replace TYPE t_indirizzo AS OBJECT (
      2  via VARCHAR(45),
      3  numero NUMBER,
      4  cap INTEGER(5),
      5  citta VARCHAR(30),
      6  provincia VARCHAR(30),
      7  regione VARCHAR(30)
      8  );
      9  /
    Type created.
    SQL>
    SQL>
    SQL> create or replace TYPE t_telefono AS OBJECT (
      2  num_tel NUMBER(15)
      3  );
      4  /
    Type created.
    SQL>
    SQL> create or replace TYPE t_listaTelefono AS TABLE OF t_telefono
      2  /
    Type created.
    SQL>
    SQL> create or replace TYPE t_cliente AS OBJECT (
      2  cod_cliente NUMBER(8),
      3  indirizzo t_indirizzo,
      4  email VARCHAR(30),
      5  telefono t_listaTelefono
      6  ) NOT FINAL;
      7  /
    Type created.
    SQL>
    SQL> CREATE TABLE cliente OF t_cliente(
      2  cod_cliente NOT NULL,
      3  indirizzo NOT NULL,
      4  email NOT NULL,
      5  PRIMARY KEY (cod_cliente)
      6  ) nested table telefono store as numTelCli_tab
      7  return as value
      8  /
    Table created.
    SQL>

  • Invalid rowid error while running the snapshot agent in transactional replication

    Hi All,
    I am getting an Invalid rowid error while replicating an large tables i.e around 30 millions rows from oracle(publisher) to sql server(Subscriber) while running the snapshot agent in transactional replication.
    Its taking around 18 hours and its then its throwing this error.
    Is there any faster way that i can replicate the initial snapshot this large table as 18 hours is very high on time.
    Kindly suggest.i am always got quick and accurate response always..hope the same in this case also.
    Thanks,

    Hi,
    Could you please create a replication with some small tables for a test?
    You can disable the firewall on both sides and rerun snapshot. Enable verbose logging to level 4 for snapshot agent and check the results if it fails.
    http://support.microsoft.com/kb/312292
    Here is a document says for the error: ORA-10632: Invalid rowid Cause: Segment Highwatermark was overwritten due to shrink and space reused Action: Reissue this command.
    I also suggest you contact the Oracle support team for further help.
    Thanks.
    Tracy Cai
    TechNet Community Support

  • Database Error while running the query.

    Hi,
    While running the query in webi rich client i am having a "database error IES 10901 and WIS 10901" , it is showing that the data source name not found and default driver is not specified.
    I am trying to generate report from efashion universe which is in .unx format, same client version and universe is running fine on another machine (webi rich client).
    PS: The above mentioned universe is running fine on my BI launch pad, the problem is with webi rich client only.
    Please help!!

    Hi,
    Which Database your are using .
    As explained by Yuvraj You need to install driver for specific database .
    Ask for client or (your Database ) driver from administrator .
    After installation you can see your database Driver in following path
    Control Panel\System and Security\Administrative Tools\Data Sources (ODBC)
    See in Drivers Tab .
    If you are using oracle & client is install on your system then Check TNS Names File in NETWORK folder .

  • Getting ORA Error while running any Query

    Hi Experts - I am getting below error message for any query i run in Webi. Please help.
    failed to execute with the error ORA-00604: error occurred at recursive SQL level 1
    ORA-01655: unable to extend cluster SYS.C_OBJ#_INTCOL# by 128 in tablespace. (WIS 10901)

    Hello communutiy, hello rohan,
    after updating patches next working day we also get this erreor message
    "ORA-00604: error occurred at recursive SQL level 1 ORA-01655: unable to extend cluster SYS.C_OBJ#_INTCOL# by 128 in tablespace"
    What have you done so far. Could you solve this issue? If yes how?
    Best regards Harry

  • 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

  • Getting ORA-01722 - Invalid number error in SQL

    I am trying to run a query like
    SELECT NVL (ic.industryclassdesc, 'NULL') industryclass,
    NVL (hci.updated_by, 'NULL') updatedby,
    NVL (hci.operation, 'NULL') operation,
    hci.audittimestamp audittimestamp
    FROM xxx_company_inxxxx hci, xxx_industry ic
    WHERE hci.company_id = 9079496
    AND ic.industryclassid = hci.industryclass_id
    ORDER BY DECODE (hci.operation, 'D', 'X', hci.operation), hci.audittimestamp
    And getting the error - ORA-01722 - Invalid number.
    But the columns - ic.industryclassid, hci.industryclass_id and also hci.company_id are 'Number' datatype and also not nullable.
    Can anyone suggest a approch

    SELECT NVL (ic.industryclassdesc, 'NULL')
    > industryclass,
    NVL (hci.updated_by, 'NULL') updatedby,
    NVL (hci.operation, 'NULL') operation,
    hci.audittimestamp audittimestamp
    xxx_company_inxxxx hci, xxx_industry ic
    WHERE hci.company_id = 9079496
    AND ic.industryclassid = hci.industryclass_id
    BY DECODE (hci.operation, 'D', 'X', hci.operation),
    hci.audittimestamp
    And getting the error - ORA-01722 - Invalid number.
    Do not enter 'String' in the nvl function,if the column is number datatype,
    venki
    null

  • ORA-37999: Serious OLAP error - while running Maintain Cube...

    While running "Maintain cube..." I'm getting error
    "Action BUILDDATABASE failed on object TEST_DB.NPE"
    Below is the stack trace. It states its a "ORA-37999: Serious OLAP error". Am I missing something or should I contact Oracle support like the statement said?
    oracle.AWXML.AWException: Action BUILDDATABASE failed on object TEST_DB.NPE
    at oracle.AWAction.BuildDatabase.Execute(BuildDatabase.java:530)
    at oracle.olap.awm.wizard.awbuild.BuildWizardHelper$1.construct(BuildWizardHelper.java:185)
    at oracle.olap.awm.ui.SwingWorker$2.run(SwingWorker.java:109)
    at java.lang.Thread.run(Unknown Source)
    Caused by: oracle.AWXML.AWException: oracle.express.ExpressServerException
    java.sql.SQLException: ORA-37999: Serious OLAP error: UPDATE. Please contact Oracle Technical Support.
    ORA-03238: unable to extend LOB segment HPMP_WH.SYS_LOB0000043088C00004$$ subpartition SYS_LOB_SUBP73 by 64 in tablespace USERS
    ORA-06512: at "SYS.GENCONNECTIONINTERFACE", line 70
    ORA-06512: at line 1
    at oracle.AWXML.AWConnection.executeCommand(AWConnection.java:279)
    at oracle.AWAction.BuildDatabase.Execute(BuildDatabase.java:513)
    ... 3 more
    Caused by: oracle.express.ExpressServerException
    java.sql.SQLException: ORA-37999: Serious OLAP error: UPDATE. Please contact Oracle Technical Support.
    ORA-03238: unable to extend LOB segment HPMP_WH.SYS_LOB0000043088C00004$$ subpartition SYS_LOB_SUBP73 by 64 in tablespace USERS
    ORA-06512: at "SYS.GENCONNECTIONINTERFACE", line 70
    ORA-06512: at line 1
    at oracle.express.spl.SPLExecutor.executeCommand(SPLExecutor.java:155)
    at oracle.AWXML.AWConnection.executeCommand(AWConnection.java:268)
    ... 4 more

    Well... it was indeed a tablespace error...no need to contact Oracle.
    Worked fine after the DBA's added more tablespace!

  • 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>

  • Getting ORA-00911: invalid character error in the func ?

    CREATE OR REPLACE FUNCTION f_get_oibt_value(argin_rollent IN VARCHAR2,
    argin_rollsubent IN VARCHAR2,
    argin_legalORdervied IN CHAR,
    argin_year IN VARCHAR2,
    argin_currmtd IN VARCHAR2)
    RETURN NUMBER AS
    ln_oibt_value NUMBER;
    ln_oibt_l_value NUMBER;
    ls_acct_id VARCHAR2(10);
    sql_stmt VARCHAR2(2999);
    BEGIN
    -- dbms_output.enable(9999);
    IF UPPER(argin_legalOrdervied) = 'L' THEN
    ls_acct_id := 'OIBT-L';
    ELSE
    ls_acct_id := 'OIBT-D';
    END IF;
    sql_stmt := 'SELECT SUM (NVL (DECODE (yr, ''' || argin_year || ''', avg_ytd_' || argin_currmtd || ', 0), 0)) ';
    sql_stmt := sql_stmt || 'FROM ma_temp_local ';
    sql_stmt := sql_stmt || 'WHERE roll_ent = :argin_rollent '; --(Input argument)
    sql_stmt := sql_stmt || 'AND roll_sub_ent = :argin_rollsubent '; --(Input argument)
    sql_stmt := sql_stmt || 'AND ent NOT IN (''817'', ''PSP'') ';
    sql_stmt := sql_stmt || 'AND acct_id = ''legal'' '; --Fixed
    sql_stmt := sql_stmt || 'AND acct = :ls_acct_id '; --Fixed
    sql_stmt := sql_stmt || 'AND rel_type = '' '' '; --Fixed
    sql_stmt := sql_stmt || 'AND acct_lvl <= ''0'' '; --Fixed
    sql_stmt := sql_stmt || 'AND yr = :argin_year '; --(Input argument)
    sql_stmt := sql_stmt || 'AND rec_type = ''A'' '; -- Fixed
    sql_stmt := sql_stmt || 'AND product_code = ''ALL'' '; -- Fixed
    sql_stmt := sql_stmt || 'AND segment_code = ''ALL'' '; -- Fixed
    sql_stmt := sql_stmt || 'GROUP BY roll_ent, roll_sub_ent;';
    --dbms_output.put_line(sql_stmt);
    EXECUTE IMMEDIATE sql_stmt
    INTO ln_oibt_l_value
    USING argin_rollent, argin_rollsubent, ls_acct_id, argin_year;
    RETURN ln_oibt_value;
    END f_get_oibt_value;
    getting below errors..
    ORA-00911: invalid character
    ORA-06512: at "F_GET_OIBT_VALUE", line 36
    ORA-06512: at line 3

    Are You Getting the error while creating the function or while excuting it
    SQL>CREATE OR REPLACE FUNCTION f_get_oibt_value(argin_rollent IN VARCHAR2,
    2 argin_rollsubent IN VARCHAR2,
    3 argin_legalORdervied IN CHAR,
    4 argin_year IN VARCHAR2,
    5 argin_currmtd IN VARCHAR2)
    6 RETURN NUMBER AS
    7
    8 ln_oibt_value NUMBER;
    9
    10 ln_oibt_l_value NUMBER;
    11 ls_acct_id VARCHAR2(10);
    12 sql_stmt VARCHAR2(2999);
    13
    14 BEGIN
    15 -- dbms_output.enable(9999);
    16 IF UPPER(argin_legalOrdervied) = 'L' THEN
    17 ls_acct_id := 'OIBT-L';
    18 ELSE
    19 ls_acct_id := 'OIBT-D';
    20 END IF;
    21
    22 sql_stmt := 'SELECT SUM (NVL (DECODE (yr, ''' || argin_year || ''', avg_ytd_' || argin_currmtd || ', 0), 0)) ';
    23 sql_stmt := sql_stmt || 'FROM ma_temp_local ';
    24 sql_stmt := sql_stmt || 'WHERE roll_ent = :argin_rollent '; --(Input argument)
    25 sql_stmt := sql_stmt || 'AND roll_sub_ent = :argin_rollsubent '; --(Input argument)
    26 sql_stmt := sql_stmt || 'AND ent NOT IN (''817'', ''PSP'') ';
    27 sql_stmt := sql_stmt || 'AND acct_id = ''legal'' '; --Fixed
    28 sql_stmt := sql_stmt || 'AND acct = :ls_acct_id '; --Fixed
    29 sql_stmt := sql_stmt || 'AND rel_type = '' '' '; --Fixed
    30 sql_stmt := sql_stmt || 'AND acct_lvl <= ''0'' '; --Fixed
    31 sql_stmt := sql_stmt || 'AND yr = :argin_year '; --(Input argument)
    32 sql_stmt := sql_stmt || 'AND rec_type = ''A'' '; -- Fixed
    33 sql_stmt := sql_stmt || 'AND product_code = ''ALL'' '; -- Fixed
    34 sql_stmt := sql_stmt || 'AND segment_code = ''ALL'' '; -- Fixed
    35 sql_stmt := sql_stmt || 'GROUP BY roll_ent, roll_sub_ent;';
    36 --dbms_output.put_line(sql_stmt);
    37 EXECUTE IMMEDIATE sql_stmt
    38 INTO ln_oibt_l_value
    39 USING argin_rollent, argin_rollsubent, ls_acct_id, argin_year;
    40
    41
    42 RETURN ln_oibt_value;
    43
    44 END f_get_oibt_value;
    45 /
    Function created.
    SQL>drop function f_get_oibt_value;
    Function dropped.
    SQL>

  • Error while running a query-Input for variable 'Posting Period is invalid

    Hi All,
    NOTE: This error is only cropping up when I input 12 in the posting period variable selection. If I put in any other value from 1-11 I am not getting any errors. Any ideas why this might be happening?
    I am getting the following error when I try and run a query - "Input for variable 'Posting Period (Single entry, mandatory)' is invalid" - On further clicking on this error the message displayed is as follows -
    Diagnosis
    Variable Posting Period (Single Value Entry, Mandatory) is used as a lower limit (X) and an upper limit () in an interval selection. This limit has the value #.
    System Response
    Procedure
    Enter a different value for variable Posting Period (Single Value Entry, Mandatory). If the value of the other limit is determined by another variable, you can change its value also.
    Procedure for System Administration

    OK.
    Well, if the variable is not used in any interval selection, then I would say "something happened to it".
    I would make a copy of the query and run it to check if I get the same problem with period 12.
       -> If not, something is wrong in the original query (you can proceed as below, if changes to original are permitted).
    If so, then try removing the variable completely from the query and hardcode restriction to 12.
       -> If problem still persists, I would have to do some thinking.
    If problem is gone, then add the variable again. Check.
       -> If problem is back, then the variable "is sick". Only quick thing to do, is to build an identical variable and use that one.
    If problem also happens with the new variable, then it's time to share this experience with someone else and consider raising an OSS.
    Good luck!
    Jacob
    P.S: what fisc year variant are you using?
    Edited by: Jacob Jansen on Jan 25, 2010 8:36 PM

  • "ORA-1722 Invalid number" error while runing a SQL script in SQL*Plus

    Hello,
    I created a SQL script that is intended to populate tables with
    baseline data. When I run the script in the SQL*Plus program
    that comes with the Oracle 8.1.6 (client), I receive an "ORA-
    1722 Invalid number".
    The error always occurs when SQL*Plus tries to execute the
    following SQL statement:
    insert into components(db_ind,module_id,ext_compid,active) values
    ('cm',modules_seq.currval,1046682,'y');
    The datatypes for the columns on the components table are as
    follows:
    db_ind varchar2(2);
    module_id number;
    ext_compid number;
    active varchar2(1);
    It seems that for some reason Oracle is having trouble
    recognizing 1046682 as a number.
    I also tried the following INSERT statements to see if that
    would work:
    insert into components(db_ind,module_id,ext_compid,active) values
    ('cm',modules_seq.currval,to_number('1046682'),'y');
    insert into components(db_ind,module_id,ext_compid,active) values
    ('cm',modules_seq.currval,'1046682','y');
    but I still receive the same error message
    Is there some NLS setting(s) I need to modify so that Oracle
    does not give me this error? Does anyone know the answer to
    this problem?
    Your help is greatly appreciated.
    Oscar
    (NOTE: I also receive this same error when trying run the
    script in SQL Navigator and Toad programs)

    Please see the following docs.
    R12: JBO-27122 Error Message Clicking On Supplier Accounting Link With Unexpected Error [ID 1218903.1]
    Supplier Management Accounting Link Gives Unexpected Error and JBO-27122 at SELECT * FROM (select pvsa.ADDRESS_STYLE [ID 1340655.1]
    Adding Accounting Information or Operating Unit Information fails with APP-FND-1564: ORACLE error 1722 in FDFGVD [ID 364265.1]
    Thanks,
    Hussein

Maybe you are looking for