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
Similar Messages
-
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
PaulHi
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 -
"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. -
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,
RobertNo, 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: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? -
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: 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, <other column names> 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 */ -
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;" -
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 43OPEN 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 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?
ThanksDECLARE
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; -
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 -
Error ORA-00903 Nome da tabela inválido ( Or in English,Invalid table name)
Hi people ! Please help me !
I´m using ODI 10.1.3.4.0 Design and in window MODELS and when I generate service, show this error message:
java.sql.SLException: ORA-00903: Nome da tabela inválido ( Invalid table name)
com.sunopsis.tools.core.exception.SnpsRuntimeException: java.sql.SQLException: ORA-00903: nome de tabela inválido
at com.sunopsis.dwg.dataservices.AbstractWSGenerator.k(AbstractWSGenerator.java)
at com.sunopsis.dwg.dataservices.AbstractWSGenerator.a(AbstractWSGenerator.java)
at com.sunopsis.dwg.dataservices.WSGenerationTask.a(WSGenerationTask.java)
at com.sunopsis.graphical.i.c.b(c.java)
at com.sunopsis.graphical.tools.utils.swingworker.v.call(v.java)
at edu.emory.mathcs.backport.java.util.concurrent.FutureTask.run(FutureTask.java:176)
at com.sunopsis.graphical.tools.utils.swingworker.l.run(l.java)
at edu.emory.mathcs.backport.java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:665)
at edu.emory.mathcs.backport.java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:690)
at java.lang.Thread.run(Thread.java:595)
Caused by: java.sql.SQLException: ORA-00903: nome de tabela inválido
at oracle.jdbc.driver.DatabaseError.throwSqlException(DatabaseError.java:125)
at oracle.jdbc.driver.T4CTTIoer.processError(T4CTTIoer.java:316)
at oracle.jdbc.driver.T4CTTIoer.processError(T4CTTIoer.java:282)
at oracle.jdbc.driver.T4C8Oall.receive(T4C8Oall.java:639)
at oracle.jdbc.driver.T4CStatement.doOall8(T4CStatement.java:113)
at oracle.jdbc.driver.T4CStatement.execute_for_describe(T4CStatement.java:431)
at oracle.jdbc.driver.OracleStatement.execute_maybe_describe(OracleStatement.java:965)
at oracle.jdbc.driver.T4CStatement.execute_maybe_describe(T4CStatement.java:463)
at oracle.jdbc.driver.OracleStatement.doExecuteWithTimeout(OracleStatement.java:1051)
at oracle.jdbc.driver.OracleStatement.executeQuery(OracleStatement.java:1184)
at com.sunopsis.dwg.snpreference.c.a(c.java)
at com.sunopsis.dwg.snpreference.c.<init>(c.java)
at com.sunopsis.dwg.codeinterpretor.g.a(g.java)
... 10 more
Caused by:
java.sql.SQLException: ORA-00903: nome de tabela inválido
at oracle.jdbc.driver.DatabaseError.throwSqlException(DatabaseError.java:125)
at oracle.jdbc.driver.T4CTTIoer.processError(T4CTTIoer.java:316)
at oracle.jdbc.driver.T4CTTIoer.processError(T4CTTIoer.java:282)
at oracle.jdbc.driver.T4C8Oall.receive(T4C8Oall.java:639)
at oracle.jdbc.driver.T4CStatement.doOall8(T4CStatement.java:113)
at oracle.jdbc.driver.T4CStatement.execute_for_describe(T4CStatement.java:431)
at oracle.jdbc.driver.OracleStatement.execute_maybe_describe(OracleStatement.java:965)
at oracle.jdbc.driver.T4CStatement.execute_maybe_describe(T4CStatement.java:463)
at oracle.jdbc.driver.OracleStatement.doExecuteWithTimeout(OracleStatement.java:1051)
at oracle.jdbc.driver.OracleStatement.executeQuery(OracleStatement.java:1184)
at com.sunopsis.dwg.snpreference.c.a(c.java)
at com.sunopsis.dwg.snpreference.c.<init>(c.java)
at com.sunopsis.dwg.codeinterpretor.g.a(g.java)
at com.sunopsis.dwg.dataservices.AbstractWSGenerator.k(AbstractWSGenerator.java)
at com.sunopsis.dwg.dataservices.AbstractWSGenerator.a(AbstractWSGenerator.java)
at com.sunopsis.dwg.dataservices.WSGenerationTask.a(WSGenerationTask.java)
at com.sunopsis.graphical.i.c.b(c.java)
at com.sunopsis.graphical.tools.utils.swingworker.v.call(v.java)
at edu.emory.mathcs.backport.java.util.concurrent.FutureTask.run(FutureTask.java:176)
at com.sunopsis.graphical.tools.utils.swingworker.l.run(l.java)
at edu.emory.mathcs.backport.java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:665)
at edu.emory.mathcs.backport.java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:690)
at java.lang.Thread.run(Thread.java:595)
Where can i do to fix this ?
Help me please ! ;-) I´m waiting for your messages !
Thanks !Hi Cezar,
I´m using AXIS2 technology and about KM´s i received a documentation of PTS team "Exercises for Lesson 13 Web Services", this is a course doc. But this isn´t said other required KM (CKM) necessary to my implementation, only SKM Oracle. Ok, when i generate this service, now show this message:
Erro durante a geração do Serviço de dados
com.sunopsis.tools.core.exception.SnpsSimpleMessageException: Você deve definir uma fonte de dados para o modelo.
Pelo seu nome você deve ser brasileiro, podemos discutir em portugues mesmo? Facilitaria bastante as coisas. :-)
Regards ou abraço ! -
ORA-00904: invalid column name - trying to sum
Hi all
probably somrthing really stupid and easy that I'm missing but here goes
I am trying to gather data from 3 tables, 1st one is stock master file - all records are unique key
2nd table is barcodes, product key can occur 2 / 3 times - one for each barcode that is assigned to a product.
3rd table is warehouse stock, again key can occur a few times as there is a key for each stock record
I need to pull the data from 1st two tables and sum the total of warehouse stock for each record pulled.
I know I will get 2 or 3 records for each stock item as each record will return with a different barcode. what I'm trying to eliminate is returning the same records again with a separate row for each set of warehouse stock records.
If I run
select rmdept||','||rmstyl||','||rmcolr||','||rmsize||','||rmvatc||','||rmshgp||','||
rmdesc||','||rmacod||','||rmcdes||','||rmzdes||','||rmsupp||','||rmsspr||','||
rmlcos||','||rsbarc||','||rmpord||','||rmmrch||','||rmcomq||','||rdcstk
from (select unique a.rmdept,a.rmstyl,a.rmcolr,a.rmsize,a.rmvatc,a.rmshgp,
a.rmdesc,a.rmacod,a.rmcdes,a.rmzdes,a.rmsupp,a.rmsspr,a.rmlcos,c.rsbarc,a.rmpord,a.rmmrch,
a.rmcomq, b.rdcstk
from stkmas a, stkwar b, stkbar c
where a.rmdept = c.rsdept(+) and a.rmstyl = c.rsstyl(+) and a.rmcolr = c.rscolr(+)
and a.rmsize = c.rssize(+) and a.rmdept = b.rddept(+) and a.rmstyl = b.rdstyl(+)
and a.rmcolr = b.rdcolr(+)
and a.rmsize = b.rdsize(+)
group by rmdept, rmstyl, rmcolr, rmsize, rmvatc, rmshgp,
rmdesc, rmacod, rmcdes, rmzdes, rmsupp, rmsspr, rmlcos, rsbarc, rmpord,
rmmrch, rmcomq, rdcstk)
order by rmdept, rmstyl, rmcolr
I get all the data I want, but duplicate rows for every stock record
53117701612,1,705,ECKO LOGO STEE W,,X*BRT.ROSE,WMN 12,G12,25,6.44,,0,LT,539,1
53117701612,1,705,ECKO LOGO STEE W,,X*BRT.ROSE,WMN 12,G12,25,6.44,,0,LT,539,228
the last column is the stock record
I would like to return just one row showing warehouse stock as 229
If I run
select rmdept||rmstyl||rmcolr||rmsize||','||rmvatc||','||rmshgp||','||
rmdesc||','||rmacod||','||rmcdes||','||rmzdes||','||rmsupp||','||rmsspr||','||
rmlcos||','||rsbarc||','||rmpord||','||rmmrch||','||rmcomq||','||sum(rdcstk)
from (select unique a.rmdept,a.rmstyl,a.rmcolr,a.rmsize,a.rmvatc,a.rmshgp,
a.rmdesc,a.rmacod,a.rmcdes,a.rmzdes,a.rmsupp,a.rmsspr,a.rmlcos,c.rsbarc,a.rmpord,a.rmmrch,a.rmcomq, b.rdcstk
from stkmas a, stkwar b, stkbar c
where a.rmdept = c.rsdept(+) and a.rmstyl = c.rsstyl(+) and a.rmcolr = c.rscolr(+)
and a.rmsize = c.rssize(+) and a.rmdept = b.rddept(+) and a.rmstyl = b.rdstyl(+)
and a.rmcolr = b.rdcolr(+)
and a.rmsize = b.rdsize(+))
group by rmdept, rmstyl, rmcolr, rmsize, rmvatc, rmshgp,
rmdesc, rmacod, rmcdes, rmzdes, rmsupp, rmsspr, rmlcos, rsbarc, rmpord,
rmmrch, rmcomq, rdcstk
order by rmdept, rmstyl, rmcolr
sum on rdcstk in first select statement, I still get two records returned
00101401409,1,001,NKE ULTRACELL M,,B/W/R CL44,SIZE 9,N01,5,15.24,0010140194095,0,FW,-1,-1
00101401409,1,001,NKE ULTRACELL M,,B/W/R CL44,SIZE 9,N01,5,15.24,0010140194095,0,FW,-1,0
If I change sum to 2nd select statement and leave the group by statement outside the brackets
select rmdept||rmstyl||rmcolr||rmsize||','||rmvatc||','||rmshgp||','||
rmdesc||','||rmacod||','||rmcdes||','||rmzdes||','||rmsupp||','||rmsspr||','||
rmlcos||','||rsbarc||','||rmpord||','||rmmrch||','||rmcomq||','||rdcstk
from (select unique a.rmdept,a.rmstyl,a.rmcolr,a.rmsize,a.rmvatc,a.rmshgp,
a.rmdesc,a.rmacod,a.rmcdes,a.rmzdes,a.rmsupp,a.rmsspr,a.rmlcos,c.rsbarc,a.rmpord,a.rmmrch,a.rmcomq, sum(b.rdcstk)
from stkmas a, stkwar b, stkbar c
where a.rmdept = c.rsdept(+) and a.rmstyl = c.rsstyl(+) and a.rmcolr = c.rscolr(+)
and a.rmsize = c.rssize(+) and a.rmdept = b.rddept(+) and a.rmstyl = b.rdstyl(+)
and a.rmcolr = b.rdcolr(+)
and a.rmsize = b.rdsize(+))
group by rmdept, rmstyl, rmcolr, rmsize, rmvatc, rmshgp,
rmdesc, rmacod, rmcdes, rmzdes, rmsupp, rmsspr, rmlcos, rsbarc, rmpord,
rmmrch, rmcomq, rdcstk
order by rmdept, rmstyl, rmcolr
I get
rmmrch, rmcomq, rdcstk
ERROR at line 14:
ORA-00904: invalid column name
If I put the group by inside the brackets
select rmdept||rmstyl||rmcolr||rmsize||','||rmvatc||','||rmshgp||','||
rmdesc||','||rmacod||','||rmcdes||','||rmzdes||','||rmsupp||','||rmsspr||','||
rmlcos||','||rsbarc||','||rmpord||','||rmmrch||','||rmcomq||','||rdcstk
from (select unique a.rmdept,a.rmstyl,a.rmcolr,a.rmsize,a.rmvatc,a.rmshgp,
a.rmdesc,a.rmacod,a.rmcdes,a.rmzdes,a.rmsupp,a.rmsspr,a.rmlcos,c.rsbarc,a.rmpord,a.rmmrch,
a.rmcomq, sum(b.rdcstk)
from stkmas a, stkwar b, stkbar c
where a.rmdept = c.rsdept(+) and a.rmstyl = c.rsstyl(+) and a.rmcolr = c.rscolr(+)
and a.rmsize = c.rssize(+) and a.rmdept = b.rddept(+) and a.rmstyl = b.rdstyl(+)
and a.rmcolr = b.rdcolr(+)
and a.rmsize = b.rdsize(+)
group by rmdept, rmstyl, rmcolr, rmsize, rmvatc, rmshgp,
rmdesc, rmacod, rmcdes, rmzdes, rmsupp, rmsspr, rmlcos, rsbarc, rmpord,
rmmrch, rmcomq, rdcstk)
order by rmdept, rmstyl, rmcolr
I get
rmlcos||','||rsbarc||','||rmpord||','||rmmrch||','||rmcomq||','||rdcstk
ERROR at line 3:
ORA-00904: invalid column name
I get the same even if I change the field names in the group by to a.rmdept etc.
rmlcos||','||rsbarc||','||rmpord||','||rmmrch||','||rmcomq||','||rdcstk
ERROR at line 3:
ORA-00904: invalid column name
any help, hints or tips greatly appreciated. this is an 8.1.7 database
Thanks
JanetThanks dnikiforov
still get the
select a.rmdept||a.rmstyl||a.rmcolr||a.rmsize||','||a.rmvatc||','||a.rmshgp||','||rmdesc||','||rmac
ERROR at line 1:
ORA-00904: invalid column name
I think its a problem with trying to select on the unique, anyway I accidentally posted a couple of threads for this and it has now been resolved by
select a.rmdept||a.rmstyl||a.rmcolr||a.rmsize||','||a.rmvatc||','||a.rmshgp||','||
a.rmdesc||',||a.rmacod||','||a.rmcdes||','||a.rmzdes||','||a.rmsupp||','||a.rmsspr||','||a.rmlcos||','||
c.rsbarc||','||a.rmpord||','||a.rmmrch||','||a.rmcomq||','||sum(b.rdcstk)
from stkmas a, stkwar b, stkbar c
where a.rmdept = c.rsdept(+)
and a.rmstyl = c.rsstyl(+)
and a.rmcolr = c.rscolr(+)
and a.rmsize = c.rssize(+)
and a.rmdept = b.rddept(+)
and a.rmstyl = b.rdstyl(+)
and a.rmcolr = b.rdcolr(+)
and a.rmsize = b.rdsize(+)
group by a.rmdept,a.rmstyl,a.rmcolr,a.rmsize,a.rmvatc,a.rmshgp,
a.rmdesc,a.rmacod,a.rmcdes,a.rmzdes,a.rmsupp,a.rmsspr, a.rmlcos,
c.rsbarc,a.rmpord,a.rmmrch,a.rmcomq
as I dont need to use the unique because the sum does it for me
Thanks again for speedy help -
Invalid Table Name SQL ReporError From Unsubmitted List of Value Table Name
I have an application in which a user selects a table name from a list of values and a SQL report shows data from the table selected. On entry into this page the "invalid table name" error shows until you select a table name.
My list of values is a LOV with redirect.
Is there any way to remove this error or not show the report?
Any help is appreciated.
Thanks,
KyleI resolved my issue by doing the following:
Create a process
Process Point - On Load - Before Header
Run Process - Once Per Session or When Reset
Process Source:
(item in list of value set equal to return value in list of value)
:P10_VERSION := 'ALLVERSIONS';
Maybe you are looking for
-
I just downloaded Firefox 5.0.1, and one of the themes I want to download and try out says that it works with Firefox 4.0b9pre - 7.0a1. At the top, though, it says that the theme is not available for my platform. It has happened with some other theme
-
When I open a new window, the current window is closed. I would like to keep the current window and open the new window without losing my current window. I checked "Open new window in a new tab instead" under tabs == This happened == Every time Firef
-
Hi Guys I migrated data from legacy system into SAP development using LSMW, I've loaded data into infotype 21 twice and there is duplicate data existing in the table, is there a way I can delete all the data and reload? Thanks Adhil
-
Error -31000 when trying to print
I've recently started getting an error message that says, "Error: pstopdffilter/pstocupsraster failed with err number -31000" whenever I try to print. I've tried recreating the PDF file, using Reader X instead of Reader 9, and restarting the printer
-
Cant install flash that is lower then ver. 11
hello, im using windows xp 32bit, IE 9. i got adobe flash ver 11. i need to install ver 10 because there is a site that i need to use the the 11 ver isnt working well with it. every time that it trie to intall a lower ver then 11it tells me that its