SQL Statement error - ORA-00903: invalid table name

Hi
I have written a sql script that gets executed from a form within e-business suite. Unfortunately, the script is falling over with an error:
unknown command beginning "MERGE INTO..." - rest of line ignored.
unknown command beginning "USING edop..." - rest of line ignored.
unknown command beginning "ON (elw.ro..." - rest of line ignored.
unknown command beginning "WHEN MATCH..." - rest of line ignored.
For a list of known commands enter HELP
and to leave enter EXIT.
      SET ELW.billed_flag          = t.billed_flag,
ERROR at line 2:
ORA-00903: invalid table name the actual statement that is causing the issue is:
MERGE INTO edopaif.table1 elw
USING edopaif.tablw2 t
ON (elw.rowid = t.LOAD_WORKING_ROWID)
WHEN MATCHED THEN
   UPDATE
      SET ELW.billed_flag          = t.billed_flag,
          ELW.last_bill_generated   = t.last_bill_generated,
          ELW.last_bill_type        = t.last_bill_type,
          ELW.load_month            = t.load_month,
          ELW.BILL_TRANSACTION_ID   = t.bill_transaction_id
WHEN NOT MATCHED THEN
   INSERT(error_meaning)
   VALUES('ROWID error with ins_ptia');The version of e-business suite that we are using is: 11.5.10.2.
The version of the Oracle database that we are using is:
Oracle9i Enterprise Edition Release 9.2.0.6.0 - 64bit Production
PL/SQL Release 9.2.0.6.0 - Production
CORE 9.2.0.6.0 Production
TNS for IBM/AIX RISC System/6000: Version 9.2.0.6.0 - Production
NLSRTL Version 9.2.0.6.0 - Production
Please note that I am able to successfully run the statement directly connected as the APPS schema in the database - the error only occurs when the script is run from the forms front-end (which is really confusing me).
Many thanks
Paul

Hi
I've modified the script to include only the statement that is erroring and it still errors when executed from the front end application.
Next I re-wrote the statement to use PL/SQL instead of the MERGE statement, to do the update, and the script completes succesfully, i.e.:
DECLARE
   CURSOR cu_lw IS
         SELECT t.billed_flag,
                t.last_bill_generated,
                t.last_bill_type,
                t.load_month,
                t.bill_transaction_id,
                t.load_working_rowid
           FROM table2 t;
BEGIN
   FOR rec_cu_lw IN cu_lw LOOP
      UPDATE table1 elw
         SET ELW.billed_flag           = rec_cu_lw.billed_flag,
          ELW.last_bill_generated      = rec_cu_lw.last_bill_generated,
          ELW.last_bill_type           = rec_cu_lw.last_bill_type,
          ELW.load_month               = rec_cu_lw.load_month,
          ELW.BILL_TRANSACTION_ID      = rec_cu_lw.bill_transaction_id
      WHERE elw.rowid                  = rec_cu_lw.load_working_rowid;
   END LOOP;
END;
/I am still unsure as to why the MERGE statement is failing when executed in the front end, but completes in the backend with no issues at all. Obviously I would prefer to use the MERGE statement instead of PL/SQL to do the update.
Thanks
Paul

Similar Messages

  • Reconciliation error: ORA-00903: invalid table name

    I am facing this error, below:
    SELECT * FROM WHERE ORC_KEY = ? AND UD_RES_P_KEY = ?: java.sql.SQLSyntaxErrorException: ORA-00903: invalid table name
    Is it a product issue from OIM 9.1.0.2?
    best regards,
    Robert

    No, it is not a product issue. Please go to the process definition tab related and
    set all Multivalued attribute as a key field in Reconciliation mapping in Process definition.
    Let me know the result, please.
    hope this helps,
    Thiago L Guimaraes

  • ORA-00903: Invalid table name - running Set based mapping

    Hello,
    Using OWB 10.2.04.36 and have created a mapping which reads data from Non-Oracle, ODBC source table, actually a worksheet in an Excel workbook which has been defined/set up using the Heterogeneous Service components.
    I can view the data in the worksheet using the Design Center, Data Object Editor, Data Viewer tab so I know the data is accessible.
    The mapping is performing a Loading Type: INSERT/UPDATE into a View which has an INSTEAD OF INSERT OR UPDATE OR DELETE ON view.
    The mapping validates okay and is deployed successfully.
    Yet when it is run in "Set based" Operating Mode from Control Center Manager the Execution Results show an "ORA-00903: Invalid table name" error is raised.
    You cannot run the mapping in any Row based operating mode as Row based running fails with "ORA:22816: Unsupported feature with RETURNING clause" due to the generated code for the INSERT/UPDATE of the view using a RETURNING clause which is actioned on an INSTEAD OF trigger.
    Looking at the generated package code I can strip out the SELECT statement from the MERGE statement for the alias "MERGE_SUBQUERY" and it runs and displays the expected result, however when the complete MERGE statement is taken and run I get the same ORA-00903 error that was reported in Control Center Manager.
    Any ideas what the problem could be? I have another mapping that reads from the same source Excel workbook/worksheet and INSERT/UPDATE into a table without an INSTEAD OF trigger, this mapping deploys, runs successfully so the issue seems to be with the INSERT/UPDATE into the view. The views are what we require to be populated.
    Thanks.

    Hi,
    But changing V_EMP_DEPT to EMP is not INSERTING/UPDATING to the view V_EMP_DEPT, what you propose is INSERTING/UPDATING into the table EMP. The code was only an example showing that the MERGE does not work when INSERTING/UPDATING into a view based on joining tables. For example say you wanted to INSERT/UPDATE the DNAME of V_EMP_DEPT then the MERGE statement generated by OWB PL/SQL mapping would use the code structure/template:-
    MERGE INTO "V_EMP_DEPT" "V_EMP_DEPT"
       USING (SELECT 5369 "EMPNO",
                     'SMITH' "ENAME",
                     'CLERK' "JOB",
                     7902 "MGR",
                     To_Date('17/12/1980','DD/MM/YYYY') "HIREDATE",
                     800 "SAL",
                     'New Dept Name" "DNAME"
              FROM   Dual,
                     "DEPT" "DEPT"
              WHERE  ("DEPT"."DEPTNO" = 20)) "MERGE_SUBQUERY"
       ON (    "V_EMP_DEPT"."EMPNO" = "MERGE_SUBQUERY"."EMPNO")
       WHEN NOT MATCHED THEN
          INSERT("V_EMP_DEPT"."EMPNO",
                 "V_EMP_DEPT"."ENAME",
                 "V_EMP_DEPT"."JOB",
                 "V_EMP_DEPT"."MGR",
                 "V_EMP_DEPT"."HIREDATE",
                 "V_EMP_DEPT"."SAL",
                 "V_EMP_DEPT"."DNAME")
          VALUES("MERGE_SUBQUERY"."EMPNO",
                 "MERGE_SUBQUERY"."ENAME",
                 "MERGE_SUBQUERY"."JOB",
                 "MERGE_SUBQUERY"."MGR",
                 "MERGE_SUBQUERY"."HIREDATE",
                 "MERGE_SUBQUERY"."SAL",
                 "MERGE_SUBQUERY"."DNAME")
       WHEN MATCHED THEN
          UPDATE
             SET "ENAME" = "MERGE_SUBQUERY"."ENAME",
                 "JOB" = "MERGE_SUBQUERY"."JOB",
                 "MGR" = "MERGE_SUBQUERY"."MGR",
                 "HIREDATE" = "MERGE_SUBQUERY"."HIREDATE",
                 "SAL" = "MERGE_SUBQUERY"."SAL",
                 "DNAME" = "MERGE_SUBQUERY"."DNAME";
    {code}
    This was only an example my target view has a lot more columns being MERGE'd into the view and joined tables.
    Cheers,
    Phil                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           

  • "ORA-00903: invalid table name" when enqueue using a CLOB in an ADT payload

    I am attempting to enqueue into an AQ that has an ADT with a CLOB field in it. If I leave the CLOB empty, it works. As soon as I place content in it, I get the error below in the BPEL log.
    I actually get the same problem when I run the "AQ_ADT_with_CLOB_Payload" example. Please help!
    Error in the BPEL log:
    <2005-11-08 09:22:07,784> <ERROR> <default.collaxa.cube.ws> <AQ Adapter::Outbound> MessageWriter_enqueue: Could not enqueue message due to database error
    <2005-11-08 09:22:07,784> <ERROR> <default.collaxa.cube.ws> <AQ Adapter::Outbound>
    java.sql.SQLException: ORA-00903: invalid table name
    at oracle.jdbc.driver.DatabaseError.throwSqlException(DatabaseError.java:137)
    at oracle.jdbc.driver.T4CTTIoer.processError(T4CTTIoer.java:304)
    at oracle.jdbc.driver.T4CTTIoer.processError(T4CTTIoer.java:271)
    at oracle.jdbc.driver.T4C8Oall.receive(T4C8Oall.java:625)
    at oracle.jdbc.driver.T4CPreparedStatement.doOall8(T4CPreparedStatement.java:181)
    at oracle.jdbc.driver.T4CPreparedStatement.execute_for_describe(T4CPreparedStatement.java:661)
    at oracle.jdbc.driver.OracleStatement.execute_maybe_describe(OracleStatement.java:951)
    at oracle.jdbc.driver.T4CPreparedStatement.execute_maybe_describe(T4CPreparedStatement.java:693)
    at oracle.jdbc.driver.OracleStatement.doExecuteWithTimeout(OracleStatement.java:1057)
    at oracle.jdbc.driver.OraclePreparedStatement.executeInternal(OraclePreparedStatement.java:2901)
    at oracle.jdbc.driver.OraclePreparedStatement.executeQuery(OraclePreparedStatement.java:2942)
    at oracle.tip.adapter.aq.database.MessageWriter.doEnqueue(MessageWriter.java:530)
    at oracle.tip.adapter.aq.database.MessageWriter.enqueue(MessageWriter.java:341)
    at oracle.tip.adapter.aq.database.MessageWriter.writeMessage(MessageWriter.java:303)
    at oracle.tip.adapter.aq.outbound.AQEnqueuer.execute(AQEnqueuer.java:108)
    at oracle.tip.adapter.aq.AQInteraction.executeRunTime(AQInteraction.java:194)
    at oracle.tip.adapter.aq.AQInteraction.execute(AQInteraction.java:180)
    at oracle.tip.adapter.fw.wsif.jca.WSIFOperation_JCA.executeRequestResponseOperation(WSIFOperation_JCA.java:469)
    at oracle.tip.adapter.fw.wsif.jca.WSIFOperation_JCA.executeInputOnlyOperation(WSIFOperation_JCA.java:652)
    at com.collaxa.cube.ws.WSIFInvocationHandler.invoke(WSIFInvocationHandler.java:441)
    at com.collaxa.cube.ws.WSInvocationManager.invoke2(WSInvocationManager.java:310)
    at com.collaxa.cube.ws.WSInvocationManager.invoke(WSInvocationManager.java:184)
    at com.collaxa.cube.engine.ext.wmp.BPELInvokeWMP.__invoke(BPELInvokeWMP.java:601)
    at com.collaxa.cube.engine.ext.wmp.BPELInvokeWMP.__executeStatements(BPELInvokeWMP.java:316)
    at com.collaxa.cube.engine.ext.wmp.BPELActivityWMP.perform(BPELActivityWMP.java:185)
    at com.collaxa.cube.engine.CubeEngine.performActivity(CubeEngine.java:3398)
    at com.collaxa.cube.engine.CubeEngine.handleWorkItem(CubeEngine.java:1905)
    at com.collaxa.cube.engine.dispatch.message.instance.PerformMessageHandler.handleLocal(PerformMessageHandler.java:75)
    at com.collaxa.cube.engine.dispatch.DispatchHelper.handleLocalMessage(DispatchHelper.java:100)
    at com.collaxa.cube.engine.dispatch.DispatchHelper.sendMemory(DispatchHelper.java:185)
    at com.collaxa.cube.engine.CubeEngine.endRequest(CubeEngine.java:5410)
    at com.collaxa.cube.engine.CubeEngine.createAndInvoke(CubeEngine.java:1300)
    at com.collaxa.cube.engine.delivery.DeliveryService.handleInvoke(DeliveryService.java:509)
    at com.collaxa.cube.engine.ejb.impl.CubeDeliveryBean.handleInvoke(CubeDeliveryBean.java:307)
    at ICubeDeliveryLocalBean_StatelessSessionBeanWrapper16.handleInvoke(ICubeDeliveryLocalBean_StatelessSessionBeanWrapper16.java:1796)
    at com.collaxa.cube.engine.dispatch.message.invoke.InvokeInstanceMessageHandler.handle(InvokeInstanceMessageHandler.java:37)
    at com.collaxa.cube.engine.dispatch.DispatchHelper.handleMessage(DispatchHelper.java:76)
    at com.collaxa.cube.engine.dispatch.BaseScheduledWorker.process(BaseScheduledWorker.java:70)
    at com.collaxa.cube.engine.ejb.impl.WorkerBean.onMessage(WorkerBean.java:86)
    at com.evermind.server.ejb.MessageDrivenBeanInvocation.run(MessageDrivenBeanInvocation.java:123)
    at com.evermind.server.ejb.MessageDrivenHome.onMessage(MessageDrivenHome.java:748)
    at com.evermind.server.ejb.MessageDrivenHome.run(MessageDrivenHome.java:921)
    at com.evermind.util.ReleasableResourcePooledExecutor$MyWorker.run(ReleasableResourcePooledExecutor.java:186)
    at java.lang.Thread.run(Thread.java:534)

    OK, I figured it out myself. :)
    Turns out when I define the queue name in the AQ Adapter definition, I was specifying "<Default Schema>" as the schema name. When I changed this to my actual schema name (eg: "SCOTT"), it worked. Nice little bug there!
    The reason it broke with the example program is because I was changing the schema name before I deployed it. As I didn't have a SCOTT schema.
    So the moral of the story here is, don't use "<Default Schema>"!
    I was running on 10.1.2.0.0 [build #1787 ]. In case anyone wants to fix this.

  • Getting ORA-00903:invalid table name with both system and table owner

    Hi All,
    Oracle version 9.2
    I'm trying to retrieve some information from a few tables and import them to Excel. I haven't got much idea about ORACLE, but I'm not able to do anything.
    I open SQL PLus, and use CONNECT SYSTEM/[email protected] AS SYSDBA
    The console shows connected.
    I use select table_name,owner from dba_tables where owner='USER1';
    I can see the tables I want to access in the output.
    I do select * from USER1.TABLE1 and also tried with select * from TABLE1, both return ORA-00903:invalid table
    I also tried to connect with "CONNECT USER1/[email protected]" also shows connected, but then same error ORA-00903:invalid table
    Could anyone guide me so I can find out whats going on wrong??
    Thanks.. Best regards!

    Great! this worked! At least now I know I can read the data.
    Now I would like to get the data from this table into Excel 2007, but I can't install Office in the ORACLE server, so I have setup my client computer (Windows 2003 server with Excel 2007).
    I installed the ORACLE ODBC driver, and put the TNSName.ora file into the network admin folder.
    I successfully create the ODBC connector, and try connection is successfull. However, when I try to get the data, Excel send an error saying that it cannot list the tables!
    Anyway, any simple solution will do. If there is an easy way of making ORACLE create for example a CSV file with all the data from the table it will be good as well. What would be the easiest way?

  • ORA-00903:invalide table name

    Hi,
    I can not understand. I'm loged into DB as sysdba :
    select table_name, owner from all_tables where table_name ='ORDER';
    TABLE_NAME                     OWNER
    ORDER                          SYS
    select * from ORDER
    error on line 1 :
    ORA-00903:invalide table name
    select * from SYS.ORDER
    error on line 1 :
    ORA-00903:invalide table nameThank for help.

    user522961 wrote:
    thank you.
    But why that ? I have always used table name without double qutation mark ?
    Regards.
    Edited by: user522961 on May 29, 2009 2:53 AMThink about this variant on your query:
    select * from order
    order by 1;What do you suppose oracle is doing when it parses your query and it sees "order" where it is expecting a table name?

  • ORA-00903: invalid table name

    I am running Toplink 9.0.3 in Oracle 9i database. I have the following code which generates an SQL statement but the table name is missing in the sub query:
    ExpressionBuilder collInventoryLines = new ExpressionBuilder();
    ExpressionBuilder maxDate = new ExpressionBuilder();
    ReportQuery subQuery = new ReportQuery(CollInventoryLines.class, maxDate);
    subQuery.addMaximum("adviceDate - max",maxDate.get("adviceDate"));
    subQuery.setSelectionCriteria(collInventoryLines.get("collPartNum").equal(orderLine.getLine().getPartNum()));
    Expression exp = (collInventoryLines.get("adviceDate").equal(collInventoryLines.subQuery(subQuery))).and
    (collInventoryLines.get("collPartNum").equal(orderLine.getLine().getPartNum()));
    ReadAllQuery qry = new ReadAllQuery (CollInventoryLines.class, exp);
    DLExpressionQuery query = new DLExpressionQuery(qry);
    query.setLock(WAIT_ON_LOCK, WAIT_TIME);
    Vector collInventoryLinesFoundVec =(Vector) ctx.executeQuery(query,true);
    This code generated the following SQL code:
    ++++++++++++++++++++++++++++++++++++
    SELECT ADVICE_DATE, COLL_QTY, &lt;other column names&gt; FROM COLLATERAL_INVENTORY_REF
    WHERE ((ADVICE_DATE = (SELECT MAX(ADVICE_DATE) FROM WHERE (COLL_PART_NUM = 'ABC1'))) AND (COLL_PART_NUM = 'ABC1'))
    ++++++++++++++++++++++++++++++++++++++++
    Note that the table name (COLLATERAL_INVENTORY_REF) is missing from the sub query.
    Any help will be appreciated.
    Thanks!

    Hi,
    Sorry for replying this late. I was assigned other tasks. The query i am using is:
    public void configureQuery(
              ReportQuery orderReportQuery,
              Object[] parameters) {
              String brand = (String) parameters[0];
              String market = (String) parameters[1];
              String modelCode = (String) parameters[2];
              String specMarket = (String) parameters[3];
    ExpressionBuilder orderBuilder = orderReportQuery.getExpressionBuilder();
    orderReportQuery.addAttribute("orderNumber",orderBuilder.get("orderNumber"));
    ExpressionBuilder specificationBuilder =new ExpressionBuilder (Specification.class);
    ReportQuery specificationSubQuery = new ReportQuery(Specification.class, specificationBuilder);
    specificationSubQuery.addMaximum(
                   "maxSpecVersionNumber",
                   specificationBuilder.get("specVersionNumber"));
    specificationSubQuery.setSelectionCriteria(specificationBuilder.getField("VISTA_ORDER_SPEC_VERS.ORDER_NO").equal(
                        orderBuilder.get("orderNumber")));
    Expression subQueryExpr = orderBuilder.subQuery(specificationSubQuery);
    Expression orderArchiveStatusExpr = orderBuilder.get("archiveStatus").equalsIgnoreCase("L");
    Expression commonOrderTypeExpr =orderBuilder.getField(
         "VISTA_ORDER.COMMON_ORDER_TYPE").equalsIgnoreCase("4");
    Expression orderBrandExpr = orderBuilder.get("brand").equalsIgnoreCase(brand);
    Expression orderMarketExpr =orderBuilder.getFiel("VISTA_ORDER.MARKET").equalsIgnoreCase(market);
    Expression orderModelCodeExpr =orderBuilder.get("modelCode").equalsIgnoreCase(modelCode);
    Expression specArchiveStatusExpr = specificationBuilder.get("archiveStatus").equalsIgnoreCase("L");
    Expression specMarketExpr = specificationBuilder.get("specMarket").equalsIgnoreCase(specMarket);
    Expression specVersionNo = specificationBuilder.get("specVersionNumber");
    Expression specVersNoMaxSpecVersNo = specVersionNo.equal(subQueryExpr);
    Expression orderCriteriaExpr = orderArchiveStatusExpr
                        .and(commonOrderTypeExpr)
                        .and(orderBrandExpr)
                        .and(orderMarketExpr)
                        .and(orderModelCodeExpr);
    Expression specificationCriteriaExpr = specArchiveStatusExpr.and(
    specMarketExpr);
    Expression selectionCriteriaExpr = orderCriteriaExpr.and (
              specificationCriteriaExpr);
    orderReportQuery.setSelectionCriteria( selectionCriteriaExpr.and(
    specVersNoMaxSpecVersNo));
    orderReportQuery.useDistinct();
    orderReportQuery.bindAllParameters();
    orderReportQuery.cacheQueryResults();
    orderReportQuery.cacheStatement();
    The SQL Statement generated bu Toplink is:
    SELECT DISTINCT t0.ORDER_NO FROM VISTA_ORDER t0, VISTA_ORDER_SPEC_VERS t1 WHERE (((((((UPPER(t0.ARCHIVE_STATUS) = 'L')
    AND (UPPER(t0.COMMON_ORDER_TYPE) = '4')) AND (UPPER(t0.BRAND) = 'SAL')) AND (UPPER(t0.MARKET) = 'UB'))
    AND (UPPER(t0.MODEL_CODE) = 'C3')) AND ((UPPER(t1.ARCHIVE_STATUS) = 'L') AND (UPPER(t1.SPEC_MARKET) = 'GBR')))
    AND (t1.SPEC_VERS_NO = (SELECT MAX(t1.SPEC_VERS_NO) FROM WHERE (t1.ORDER_NO = t0.ORDER_NO))))
    bind => [L, 4, SAL, UB, G1, L, GBR]
    The issues here are:
    1. The table name is missing i.e. VISTA_ORDER_SPEC_VERS from the sub select statement.
    2. when i add the table name to the query, it runs 200 times slower than the following query i wrote.
    SELECT distinct vo.order_no FROM VISTA_ORDER vo, VISTA_ORDER_SPEC_VERS vosv
    WHERE vo.archive_status = 'L' AND vosv.archive_status = 'L' AND vo.common_order_type = '4'
    AND vo.brand = 'SAL' AND vo.market = 'UB' AND vo.model_code = 'C3' AND vosv.spec_market = 'GBR'
    AND vo.order_no = vosv.order_no AND vosv.spec_vers_no = (SELECT MAX(z.spec_vers_no) FROM vista_order_spec_vers z WHERE vo.order_no = z.order_no)
    Message was edited by:
    boleccic

  • Query cannot be parsed(ORA-00903: invalid table name)

    Hi all,
    I am creating a report on a remote table using a database link which connects to the system schema so it can access any schema tables in the link.
    But the schema name and db_link name is variable which is passed on by the "parent" table which has column "schema" and "db_link".
    So the link report base sql query is
    SELECT * FROM :P2_SCHEMA.EMP@:P2_DB_LINKIs this not allowed? Can I have a workaround for this?
    Thanks a lot,

    jozef_SVK wrote:
    declare
    stmt varchar2(32767);
    begin
    /* some stuff preparing sql query string */
    stmt := 'SELECT * FROM '&P2_SCHEMA.||'EMP@'||&P2_DB_LINK.'
    return stmt;
    end;
    This exposes SQL Injection vulnerabilities.
    <li>Do not use <tt>SELECT *</tt> if the column names are known: use a column list.
    <li>Do not use <tt>&P2_SCHEMA.</tt> string substitution in SQL and PL/SQL: use bind variables (<tt>:P2_SCHEMA</tt>) or session state functions (<tt>v('P2_SCHEMA')</tt>)
    <li>Validate variables contain what they're supposed to using <tt>dbms_assert</tt>:
    return 'select empno, ename, job from ' || dbms_assert.simple_sql_name(:p2_schema) || '.emp@' || dbms_assert.simple_sql_name(:p2_db_link);
    /* Using dbms_assert.simple_sql_name instead of dbms_assert.schema_name as schema is on a remote DB */

  • Default Errors= ORA-00904: invalid column name

    Hi,
    I nto expert in plsql , whenever i'm trying to run procedure or function mostly i got this same error and even i didn't view the error using
    show errors ,
    show errors procedure|function name
    CREATE OR REPLACE PROCEDURE SEND_MAIL (
    ERROR at line 1:
    ORA-00604: error occurred at recursive SQL level 1
    ORA-20000: ORA-00904: invalid column name
    ORA-06512: at line 13
    plz explain why this error often display
    regards
    venki

    Hi,
    unless just give me a suitable thread, please...

  • How to resolve error ORA-29491: invalid table for chunking?

    Hello,
    I'm trying to implement DBMS_PARALLEL_EXECUTE to speed up a huge update I need to do. I'm stuck on a problem with the table I'm using to test my procedure. Here's a simple test that produces the same error. As best I can tell, the table I'm declaring here is missing some kind of requirement that lets DBMS_PARALLEL_EXECUTE make use of it, but the docs and searching for the error code haven't turned up any useful discussions. Please help.
    drop table owner.why_cant_i_hold;
    create table owner.why_cant_i_hold (
    things VARCHAR2 (64),
    amount INT,
    CONSTRAINT why_cant_i_pk PRIMARY KEY (things)
    insert into why_cant_i_hold values ('limes', 8);
    insert into why_cant_i_hold values ('lemons', 8);
    insert into why_cant_i_hold values ('watermelons', 5);
    insert into why_cant_i_hold values ('cats', 4);
    insert into why_cant_i_hold values ('teacups',10);
    insert into why_cant_i_hold values ('mugs', 5);
    insert into why_cant_i_hold values ('eggs', 15);
    insert into why_cant_i_hold values ('jobs', 3);
    commit;
    -- got tasks?
    COLUMN task_name FORMAT A10
    SELECT task_name,
    status
    FROM user_parallel_execute_tasks;
    --exec DBMS_PARALLEL_EXECUTE.CREATE_TASK('holding');
    exec DBMS_PARALLEL_EXECUTE.CREATE_CHUNKS_BY_ROWID('holding', 'ODDEV03', 'why_cant_i_hold', true, 3);
    It seems like a really simple case here. The output is all successful until
    "Error starting at line 25 in command:
    exec DBMS_PARALLEL_EXECUTE.CREATE_CHUNKS_BY_ROWID('holding', 'owner', 'why_cant_i_hold', true, 3);
    Error report:
    ORA-29491: invalid table for chunking
    ORA-06512: at "SYS.DBMS_PARALLEL_EXECUTE", line 27
    ORA-06512: at "SYS.DBMS_PARALLEL_EXECUTE", line 121
    ORA-06512: at line 1"

    Oh. This was an easy one, table names are never really lower-case. Changing the value in my chunking call fixed the simple test:
    exec DBMS_PARALLEL_EXECUTE.CREATE_CHUNKS_BY_ROWID('holding', 'ODDEV03', 'WHY_CANT_I_HOLD', true, 3);
    It doesn't help with why my more complicated test case isn't working, but I have details to check before I ask again.
    EDIT: lesson learned... 'invalid table' doesn't mean the database can find the table you are talking about at all. I hope that's a help.
    Edited by: user519442 on Nov 16, 2011 12:33 PM

  • Invalid table name when pass in the table name as variable in dynamic sql

    Hi,
    I need to create a stored procedure which will return a list of data to my java application like the following.
    first, select the table name from the first table.
    For example : SELECT T_NAME FROM MDR_SMSTABLES
    second, select the data from the table which returned by first select statement
    For example : SELECT * FROM T_NAME.
    I use dynamic sql with cursor to select the data. But it returns "java.sql.SQLException: ORA-00903: invalid table name"
    I fetch the table name to varchar2. I think this might the cause it returns me the this error. But i don't know what type should i put for the table name other then varchar2.
    val2 VARCHAR2(200);
    OPEN cv FOR
    SELECT T_NAME FROM MDR_SMSTABLES WHERE T_DATE=d_dt_sent;
    FETCH cv INTO val2;
    WHILE cv%FOUND
    LOOP
    OPEN refcur FOR
    'SELECT * FROM :t WHERE MID = :m' USING val2, msg_id;
    EXIT WHEN refcur IS NOT NULL;
    FETCH cv INTO val2;
    END LOOP;
    As my stored procedure is quite long, so i just paste some of the code here. Hope the information is enough. Can anyone please help?
    Thanks

    DECLARE
    val2 VARCHAR2 (200);
    cv sys_refcursor;
    refcur sys_refcursor;
    BEGIN
    OPEN cv FOR
    SELECT table_name
    FROM user_tables
    WHERE table_name IN ('EMP', 'DEPT');
    FETCH cv INTO val2;
    WHILE cv%FOUND
    LOOP
    OPEN refcur FOR 'SELECT * FROM '||val2;
    EXIT WHEN refcur IS NOT NULL;
    FETCH cv INTO val2;
    END LOOP;
    END;

  • Dynamic Select query is failing with error "Invalid Table Name"

    OPEN rc FOR 'SELECT count(*) from :s' USING tab_name;
    fetch rc into rec_count;
    CLOSE rc;
    my requirement is to build dynamic select query to retrieve the total count of rows in each table ( variable tab_name contains the table_name )
    But I am getting stuck by this errror, not sure if there is any alternative !
    ORA-00903: invalid table name
    ORA-06512: at line 43

    OPEN rc FOR 'SELECT count(*) from '||tab_name;
    fetch rc into rec_count;
    CLOSE rc;
    -- This will work
    1. Create a sql statement.
    2. Open ref cursor for that statement.

  • Invalid Table Name error in EXECUTE IMMEDIATE

    Hi there.
    I am trying to truncate few debug tables I created a used ago. Refer the code
    declare
    lv_sql varchar2(100) := 'truncate table :b1';
    begin
    for i in (select object_name
                 from all_objects
                where object_type = 'TABLE'
                  and object_name like 'DEBUG_%'
                  and owner = user)
    loop             
       dbms_output.put_line('Table Name: '||i.object_name);
       execute immediate lv_sql using i.object_name;
    end loop;
    end;Seems to be correct (unless I messed something big). And, I get an error message:
    ORA-00903: invalid table name
    ORA-06512: at line 13Any idea? Thanks in advance.

    you can't bind table or column names... try this instead:
    declare lv_sql varchar2(100);
    begin for i in (select object_name
                  from all_objects
                where object_type = 'TABLE'
                  and object_name like 'DEBUG_%'
                  and owner = user) loop
                     dbms_output.put_line('Table Name: '||i.object_name);
       lv_sql := 'truncate table '||i.object_name;
       execute immediate lv_sql;
    end loop;
    end;Message was edited by:
    RACER
    forgot ending  tag

  • SAP Ides ECC 6.0 Install: Import ABAP - Package SAPDODS Error - ORA-00903

    Experts,
    Good Morning!
    I'm trying to install SAP IDES ECC 6.0 version on a Windows 2008 R2 Server with Oracle 11g DB (11.2).
    System Info: 16GM RAM & 600GB Hdd. Prereqs passed.
    I'm getting the following error during the Import ABAP phase (16 of 29) in the sapinst log:
    "An error occurred while processing option Enhancement Package 6 for SAP ERP 6.0 > SAP Application Server ABAP > Oracle > Central System > Central System( Last error reported by the step: Program 'Migration Monitor' exits with error code 103. "
    Here's the dump of import_monitor.java.log
    java version "1.4.2_32"
    Java(TM) 2 Runtime Environment, Standard Edition (build 4.1.012)
    SAP Java Server VM (build 4.1.012 1.6-b03, Oct 21 2011 14:18:45 - 41_REL - optU - windows amd64 - 6 - bas2:161688 (mixed mode))
    Import Monitor jobs: running 1, waiting 1, completed 141, failed 0, total 143.
    Loading of 'SAPDODS' import package: ERROR
    Import Monitor jobs: running 0, waiting 1, completed 141, failed 1, total 143.
    Here's the dump of import_monitor.log:
    INFO: 2014-07-05 13:42:53
    Data codepage 4103 is determined using TOC file 'C:\Target\Export1\DATA\D010TAB.TOC' for package 'D010TAB'.
    TRACE: 2014-07-05 13:42:53 com.sap.inst.migmon.LoadTask run
    Loading of 'SAPDODS' import package is started.
    TRACE: 2014-07-05 13:42:53 com.sap.inst.migmon.LoadTask processPackage
    Loading of 'SAPDODS' import package into database:
    C:\usr\sap\AVV\SYS\exe\uc\NTAMD64\R3load.exe -i SAPDODS.cmd -dbcodepage 4103 -l SAPDODS.log -stop_on_error
    ERROR: 2014-07-05 13:42:54 com.sap.inst.migmon.LoadTask run
    Loading of 'SAPDODS' import package is interrupted with R3load error.
    Process 'C:\usr\sap\AVV\SYS\exe\uc\NTAMD64\R3load.exe -i SAPDODS.cmd -dbcodepage 4103 -l SAPDODS.log -stop_on_error' exited with return code 2.
    For mode details see 'SAPDODS.log' file.
    Standard error output:
    sapparam: sapargv(argc, argv) has not been called!
    sapparam(1c): No Profile used.
    sapparam: SAPSYSTEMNAME neither in Profile nor in Commandline
    WARNING: 2014-07-05 13:43:21
    Cannot start import of packages with views because not all import packages with tables are loaded successfully.
    WARNING: 2014-07-05 13:43:21
    1 error(s) during processing of packages.
    INFO: 2014-07-05 13:43:21
    Import Monitor is stopped.
    Here's the log of SAPDODS...
    C:\usr\sap\AVV\SYS\exe\uc\NTAMD64\R3load.exe: START OF LOG: 20140705134253
    C:\usr\sap\AVV\SYS\exe\uc\NTAMD64\R3load.exe: sccsid @(#) $Id: //bas/720_REL/src/R3ld/R3load/R3ldmain.c#13 $ SAP
    C:\usr\sap\AVV\SYS\exe\uc\NTAMD64\R3load.exe: version R7.20/V1.4 [UNICODE]
    Compiled Aug 16 2011 02:26:36
    patchinfo (patches.h): (0.098) DB6: correction for R3load PL 91 on HP-UX and SOLARIS (note 1609719)
    process id 1488
    C:\usr\sap\AVV\SYS\exe\uc\NTAMD64\R3load.exe -i SAPDODS.cmd -dbcodepage 4103 -l SAPDODS.log -stop_on_error
    DbSl Trace: ORA-1403 when accessing table SAPUSER
    (DB) INFO: connected to DB
    (DB) INFO: DbSlControl(DBSL_CMD_NLS_CHARACTERSET_GET): UTF16
    (SQL) INFO: Searching for SQL file SQLFiles.LST
    (SQL) INFO: SQLFiles.LST not found
    (SQL) INFO: Searching for SQL file C:\Target\Export1\DB/SQLFiles.LST
    (SQL) INFO: C:\Target\Export1\DB/SQLFiles.LST not found
    (SQL) INFO: Searching for SQL file DODS.SQL
    (SQL) INFO: DODS.SQL not found
    (SQL) INFO: Searching for SQL file C:\Target\Export1\DB/ORA/DODS.SQL
    (SQL) INFO: found C:\Target\Export1\DB/ORA/DODS.SQL
    (SQL) INFO: Trying to open C:\Target\Export1\DB/ORA/DODS.SQL
    (SQL) INFO: C:\Target\Export1\DB/ORA/DODS.SQL opened
    (DB) ERROR: DDL statement failed
    (DROP TABLE "/BI0/APERS_BOD00")
    DbSlExecute: rc = 103
      (SQL error 942)
      error message returned by DbSl:
    ORA-00942: table or view does not exist
    (IMP) INFO: a failed DROP attempt is not necessarily a problem
    DbSl Trace: Error 903 in exec_immediate() from oci_execute_stmt(), orpc=0
    DbSl Trace: ORA-00903 occurred at SQL stmt (parse error offset=15)
    (DB) ERROR: DDL statement failed
    (  CREATE TABLE [/BI0/APERS_BOD00]         (  [TCTUSERNM] nvarchar(000012)          NOT NULL  ,           [TCTOBJVERS] nvarchar(000001)          NOT NULL  ,           [TCTSYSID] nvarchar(000010)          NOT NULL  ,           [TCTQUACT] nvarchar(000001)          NOT NULL  ,           [TCTOBJNM] nvarchar(000040)          NOT NULL  ,           [TCTTLOGO] nvarchar(000004)          NOT NULL  ,           [RECORDMODE] nvarchar(000001)          NOT NULL  ,           [TCTTIMSTMP] nvarchar(000014)          NOT NULL   )          WITH ( DATA_COMPRESSION = PAGE )   )
    DbSlExecute: rc = 99
      (SQL error 903)
      error message returned by DbSl:
    ORA-00903: invalid table name
    (DB) INFO: disconnected from DB
    C:\usr\sap\AVV\SYS\exe\uc\NTAMD64\R3load.exe: job finished with 1 error(s)
    C:\usr\sap\AVV\SYS\exe\uc\NTAMD64\R3load.exe: END OF LOG: 20140705134254
    FYI - A retry does not help. Also tried to search for the error on scn, google but haven't been able to find the right solution.
    Can you help?
    Regards,
    Cobain.

    Divyanshu - sorry to ask but can you explain why i need to update r3load and r3trans to resolve this error? Just want to understand why I'm doing a correction so I can learn from the same.
    Also, can you clarify the file update process:
    For R3load:
    a) the r3load used by the command is dated 8/16/2011 (location:C:\usr\sap\AVV\SYS\exe\uc\NTAMD64\...)
    b) the r3load i have in my db folder is dated 10/23/2011 (location:C:\Final\Installer\BS7i2011_Installation_Master_\DATA_UNITS\BS2011_IM_WINDOWS_X86_64\ORA\UC\...)
    Do i replace (a) with (b)?
    For R3trans:
    How do I update this file?
    - Cobain.

  • Invalid Table Name

    There is an Oracle database set up on our network with data I need to extract. I have an odbc connection to this database.
    When I connect via MS Access to link the table, the table name is listed DOVE.MCORPS.
    When I connect to the database and use the metadata to display the table names, the name is listed as simply MCORPS. So, I know I have properly connected to the database. However, when my SQL statement says, "Select NAMES from [MCORPS];" I get an error that reads "ORA-00903: Invalid Table Name".
    Please help.

    "Select NAMES from [MCORPS];" why do you have the brackets...?
    try changing it to
    "Select NAMES from MCORPS;"

Maybe you are looking for

  • Issue with the App Store showing up blank.

    Issue with the App Store, it will not let me search for new apps.  The screen is blank.  The update section and features section works, but it will not let me search for new apps. I have restarted my phone and no changes. The newest update to the iph

  • Exchange 2010 , Windows 2008 R2 and framework 3.5 SP1

    Hi all , I have questation about protection exchange server 2010 with framework 3.51 SP1 running in the windows 2008r2 serveru . The DPM server is instaled in the windows 2012r2 server and supported version in this os is 2012R2 RU5 . After install i

  • How can i do this?

    I have an oracle server on my computer. and i wanna connect from mobile phone with a java mobile application in mobile phone to my oracle server (localhost) that works on pc. I could connect to Oracle with my Java Application(j2se). There is no probl

  • Error message while syncing contacts with windows address book

    getting error message while syncing contacts from windows address book cradsstring something

  • This should be a simple answer to a simple question.

    Hey gurus, I've looked all over this Forum and the JDeveloper 9i tutorial but I can't figure out how to disable the picklist box from my resultset. The searchable object is assigned to "MessageChoice" for the search option but that picklist value sho