PL/SQL: ORA-00904:
Hello..
We have custom package which is working fine since long time. But all at once we are getting compilation errors.. The following are the error messages that we are getting
233/13 PL/SQL: SQL Statement ignored
248/20 PL/SQL: ORA-00904: "SLIP_TYPE": invalid identifier
254/13 PL/SQL: SQL Statement ignored
262/20 PL/SQL: ORA-00904: "SLIP_TYPE": invalid identifier
527/16 PL/SQL: SQL Statement ignored
593/36 PL/SQL: ORA-00904: "SLIP_DATE": invalid identifier
597/16 PL/SQL: SQL Statement ignored
636/36 PL/SQL: ORA-00904: "SLIP_DATE": invalid identifier
The same package is working fine in all the other instances .
I don't know what else to suggest, so I'll point you to the error code:
ORA-00904: string: invalid identifier
Cause: The column name entered is either missing or invalid.
Action: Enter a valid column name. A valid column name must begin with a letter, be less
than or equal to 30 characters, and consist of only alphanumeric characters and the
special characters $, _, and #. If it contains other characters, then it must be
enclosed in double quotation marks. It may not be a reserved word.And here you can see how an ORA-00904 happens.
SQL> create table pos_header
2 ( slip_date date
3 , slip_type varchar2(1)
4 )
5 /
Tabel is aangemaakt.
SQL> create procedure test1
2 as
3 begin
4 update pos_header
5 set slip_date = sysdate
6 where slip_type = 'A'
7 ;
8 end;
9 /
Procedure is aangemaakt.
SQL> show err
Er zijn geen fouten.
SQL> exec test1
PL/SQL-procedure is geslaagd.
SQL> alter table pos_header drop column slip_type
2 /
Tabel is gewijzigd.
SQL> exec test1
BEGIN test1; END;
FOUT in regel 1:
.ORA-06550: line 1, column 7:
PLS-00905: object RWK.TEST1 is invalid
ORA-06550: line 1, column 7:
PL/SQL: Statement ignored
SQL> alter procedure test1 compile
2 /
Waarschuwing: procedure is gewijzigd met compilatiefouten.
SQL> show err
Fouten voor PROCEDURE TEST1:
LINE/COL ERROR
4/3 PL/SQL: SQL Statement ignored
6/10 PL/SQL: ORA-00904: "SLIP_TYPE": invalid identifierHope this helps assuring you that the column is missing and I hope you'll find out the table and schema where this column is missing.
Regards,
Rob.
Similar Messages
-
I have a PL/SQL script processing information between Oracle database and MySQL database. My script ran perfectly with DG4ODBC 11.1.0.7. Then we upgraded Oracle to 10.2.0 and DG4ODBC 11.2.0.2. Now if I run my script from Solaris command line like ./myscript.shl, I get the following errors:
PL/SQL: ORA-00904: "cmswhit_moodle1"."mdl_grade_grades"."finalgrade": invalid identifier
PL/SQL: ORA-00904: "cmswhit_moodle1"."mdl_question_states"."attempt": invalid identifier
The strange thing is if I run the same query by cut and paste into sqlplus from command line, the query works perfectly without any problems.
What is the cause of this problem?
Any help would be greatly appreciated.
JeffreyHi Klaus,
The problem was solved after I updated MySQL ODBC to a new version from 5.1.8 to 5.1.13.
Summary of the problem and its solution:
The Problem: It appears that dg4odbc 11.2.0.2 requires a newer version of MyODBC. Previously I used MyODBC 5.1.8 which ran into problems with dg4odbc 11.20.0.2.
The Solution: After I updated MyODBC to 5.1.13, my PL/SQL scripts all work.
I need to point out that with MyODBC 5.1.8, I can run queries and updates from SQL*Plus console, but now PL/SQL scripts.
I'll close this thread.
Once again, thank you and happy holidays.
Jeffrey -
Hi
I have done a form personlization and download it as .ldt file using FNDLOAD.
command used:
FNDLOAD apps/dvpins93 0 Y DOWNLOAD $FND_TOP/patch/115/import/affrmcus.lct KPMNPOINV_LD.ldt FND_FORM_CUSTOM_RULES function_name="KPMNPOINV"
log file:
Application Object Library: Version : 11.5.0 - Development
Copyright (c) 1979, 1999, Oracle Corporation. All rights reserved.
module:
Current system time is 24-DEC-2009 15:12:26
Downloading FND_FORM_CUSTOM_RULES to the data file KPMNPOINV_LD.ldt
Downloaded FND_FORM_CUSTOM_RULES 1204
Concurrent request completed successfully
Current system time is 24-DEC-2009 15:12:27
After that i have uploaded the .ldt file using FNDLOAD after removing the personalization from that form, just to check whether it is upoloaded or not.
But the problem, when i uploaded the file it gives me an error PL/SQL: ORA-00904: "LAST_UPDATED_DATE": invalid identifier
command used:
FNDLOAD apps/dvpins93 0 Y UPLOAD $FND_TOP/patch/115/import/affrmcus.lct KPMNPOINV_LD.ldt
log file:
Application Object Library: Version : 11.5.0 - Development
Copyright (c) 1979, 1999, Oracle Corporation. All rights reserved.
module:
Current system time is 24-DEC-2009 16:55:17
Uploading from the data file KPMNPOINV_LD.ldt
Altering database NLS_LANGUAGE environment to AMERICAN
Dump from LCT/LDT files (/appldvp/apps/prodappl/fnd/11.5.0/patch/115/import/affrmcus.lct(115.1), KPM
NPOINV_LD.ldt) to stage tables
Dump LCT file /appldvp/apps/prodappl/fnd/11.5.0/patch/115/import/affrmcus.lct(115.1) into FND_SEED_S
TAGE_CONFIG
Dump LDT file KPMNPOINV_LD.ldt into FND_SEED_STAGE_ENTITY
Dumped the batch (FND_FORM_CUSTOM_RULES 1204 , FND_FORM_CUSTOM_SCOPES 1204 20 ) into FND_SEED_STAGE
_ENTITY
Upload from stage tables
Error during uploading. ORA-06550: line 354, column 17:
PL/SQL: ORA-00904: "LAST_UPDATED_DATE": invalid identifier
ORA-06550: line 347, column 1:
PL/SQL: SQL Statement ignored
Concurrent request completed
Current system time is 24-DEC-2009 16:55:18
I am not able to understand the actual problem as there is nothing like LAST_UPDATED_DATE.
Please suggest me something so that i can solve this problemHi,
Please refer to:
Note: 287417.1 - Parameters Of Different Configuration Files To Download And Upload Seed Data Types
For forms personalization, please refer to:
Note: 395117.1 - Form Personalizations in Oracle E-Business Suite (Release 12)
Note: 743490.1 - Customization in Oracle Applications
There are many documents available on Metalink, just search for FNDLOAD and you will get many hits.
Regards,
Hussein -
How to catch PL/SQL: ORA-00904 error?
Hi ,
I am trying to run the following PL/SQL Block and have trapped error code -904( for invalid column name) in the exception section block.
The column name in the select query does not exist in the emp table and as per my understanding since I have an exceptiion handler for this error it should be handled in Exception Block.
DECLARE
invalid_column exception;
pragma exception_init (invalid_column,-00904);
no number;
BEGIN
select empn into no from emp
where ename='king';
EXCEPTION
when invalid_column then
dbms_output.put_line(Column ane does not exist)
end;
1) Can You please let me know why this is not getting caught in Exception handler
*2) What changes should I make in Exception handler section so that Invalid column name is handled in the program*
Thanks and regards
HarmeetCheck this:
SQL> ed
Wrote file afiedt.buf
1 DECLARE
2 invalid_column EXCEPTION;
3 PRAGMA EXCEPTION_INIT(invalid_column,-00904);
4 v_col_check NUMBER := 0;
5 v_col_name VARCHAR2(10) := 'OWNE';
6 BEGIN
7 select COUNT(*) INTO v_col_check
8 from all_tab_cols
9 where table_name = 'ALL_OBJECTS'
10 AND column_name = v_col_name;
11 IF (v_col_check = 0) THEN
12 RAISE invalid_column;
13 END IF;
14 EXCEPTION
15 WHEN invalid_column THEN
16 DBMS_OUTPUT.PUT_LINE('Column '||v_col_name ||' does not exist in table all_objects');
17* END;
SQL> /
Column OWNE does not exist in table all_objects
PL/SQL procedure successfully completed.
SQL> This way you can check if the column is valid or not in case you are dynamically getting the column names -
Pl/SQL Error ORA-00904 not showing in Oracle SQL Developer
Hi,
I am new to Oracle and the various development tools available.
Whilst using Oracle SQL Developer we have come across a scenario where a PL/SQL package does not compile, but only shows warnings in the compiler log.
The same packeage when compiled using PL/SQL Navigator shows a much more detailed list of errors, and highlights the real problem.
Why does Oracle SQL Developer not show the following error?
PL/SQL: ORA-00904: "SERIAL_LINE_ID": invalid identifier
Regards
AdrianThere are various settings you can give to messages. (eg, informational, warning, severe).
Tools-PL/SQL compiler options.
Normally, just the first 20 messages are displayed.
Either change code to get rid of warning messages, or change settings to ignore informational and warning messages.
P.S. There is a dedicated sqldeveloper forum where your question should really have been posted.
Edited by: Keith Jamieson on Mar 9, 2009 1:45 PM -
Error ORA-00904 invalid identifier
There are so many different employee rates colums in the employee table .
e.g)
emp_rate_1 column has all different salaries(10,20,30)
emp_rate_2 column has all different salaries(20,30,40)
If I do pick up one rate , it works fine as below
select
SUM(emp_rate_1) as emp_rate_1
from employee_t
result $60
but i have to summarize all different rate amount using loop. before looping method,
I tried as simple like below
declare
V_emp_rate_1_ID number;
begin
V_emp_rate_1_ID :=1;
select
SUM(emp_rate_||trim(V_emp_rate_1_ID)) as emp_rate_1
from employee_t ;
end;
I have an error message;
PL/SQL: ORA-00904: "emp_rate_": invalid identifier
ORA-06550: line 5, column 1:
PL/SQL: SQL Statement ignored
06550. 00000 - "line %s, column %s:\n%s"
*Cause: Usually a PL/SQL compilation error.
*Action:
how can I put dynamic column into Sum() in the query?
or would you give me your advice to solve the solution.Not clear whether you are trying to get two sums (one for each column) or one sum that totals both columns)
select
SUM(emp_rate_1) as emp_rate_1
from employee_t
result $60But you can do all three with one query
select
SUM(emp_rate_1) as emp_rate_1, sum(emp_rate_2) as emp_rate_2, sum (emp_rate_1 + emp_rate_2) as sum_both
from employee_t -
Hi,
I have a cursor which queries some tables over a DBLINK. The remote
database is Oracle 8.1.7.4 and package is being compiled on 10.2.0.3
Since this morning I am getting the below error message while trying
to compile the package:
112/10 PL/SQL: ORA-00904: "MIL"."ORGANIZATION_ID": invalid
identifier
However, when I run the cursor query in a different SQL session, it
fetches data. The cursor definition is
CURSOR curLocators(pOrganizationId NUMBER) IS
SELECT ood.organization_code organization_code
,NULL row_organization_id
,mil.segment1||'.'||mil.segment2||'.'||mil.segment3||'.'||
mil.segment4 Concatenated_Segments
,NULL row_item_id
,mil.description
,mil.inventory_location_type --no longer used
,mil.picking_order
,mil.location_maximum_units
,mil.subinventory_code
FROM mtl_item_locations@convsourcedb mil
,mtl_material_statuses_vl@convsourcedb mms
,org_organization_definitions@convsourcedb ood
,(SELECT sum(total_qoh) total_qoh,
subinventory_code,
organization_id,
locator_id
FROM mtl_onhand_locator_v@convsourcedb
GROUP BY locator_id, subinventory_code,
organization_id
) mol
WHERE 1=1
AND NVL(mil.status_id,1) = mms.status_id(+)
AND ood.organization_id = mil.organization_id
AND mms.status_code = 'Active'
AND mil.enabled_flag = 'Y'
AND mol.organization_id = mil.organization_id
AND mol.locator_id = mil.inventory_location_id
AND mil.organization_id = pOrganizationId
The column definetely exists in the base table
SQL> select organization_id from mtl_item_locations@convsourcedb where
rownum=1;
ORGANIZATION_ID
216
I tried to comment out the where clause which is throwing the error,
but the package compilation fails with another Where clause error.
All this was working absolutely fine till last evening and I have not
changed the cursor query since then.
How can I rectify this?
Any inputs would be greatly appreciated.
Thanks,
AshishHi Ashish,
Maybe the link user and the owner of the remote table are not the same?
What do you have here :
select tab.owner remote_owner, lnk.username link_user
from all_db_links lnk, all_tables@convsourcedb tab
where tab.table_name = 'MTL_ITEM_LOCATIONS'
and lnk.db_link = 'CONVSOURCEDB';Regards
Peter -
Hi everyone,
we are facing the below issue when trying to schedule a BI report.
Error Details:
+oracle.apps.xdo.servlet.scheduler.ProcessingException: Exception [TOPLINK-4002] (Oracle TopLink - 11g Release 1 (11.1.1.0.0) (Build 080319)): oracle.toplink.exceptions.DatabaseException+
Internal Exception: java.sql.SQLException: ORA-00904: "SEQ_NAME": invalid identifier
Error Code: 904
Call: UPDATE SEQUENCE SET SEQ_COUNT = SEQ_COUNT 50 WHERE SEQ_NAME = 'JOB_ID_SEQ'+
Query: DataModifyQuery()
+ at oracle.apps.xdo.servlet.scheduler.toplink.ToplinkDataHandler.insertJob(ToplinkDataHandler.java:830)+
+ at oracle.apps.xdo.servlet.ui.scheduler.SchedulerServlet.scheduleJob(SchedulerServlet.java:1896)+
+ at oracle.apps.xdo.servlet.ui.scheduler.SchedulerServlet.doPost(SchedulerServlet.java:293)+
+ at javax.servlet.http.HttpServlet.service(HttpServlet.java:763)+
+ at javax.servlet.http.HttpServlet.service(HttpServlet.java:856)+
+ at com.evermind.server.http.ResourceFilterChain.doFilter(ResourceFilterChain.java:64)+
+ at oracle.apps.xdo.servlet.security.SecurityFilter.doFilter(SecurityFilter.java:94)+
+ at com.evermind.server.http.ServletRequestDispatcher.invoke(ServletRequestDispatcher.java:621)+
+ at com.evermind.server.http.ServletRequestDispatcher.forwardInternal(ServletRequestDispatcher.java:368)+
+ at com.evermind.server.http.HttpRequestHandler.doProcessRequest(HttpRequestHandler.java:866)+
+ at com.evermind.server.http.HttpRequestHandler.processRequest(HttpRequestHandler.java:448)+
+ at com.evermind.server.http.HttpRequestHandler.serveOneRequest(HttpRequestHandler.java:216)+
+ at com.evermind.server.http.HttpRequestHandler.run(HttpRequestHandler.java:117)+
+ at com.evermind.server.http.HttpRequestHandler.run(HttpRequestHandler.java:110)+
+ at oracle.oc4j.network.ServerSocketReadHandler$SafeRunnable.run(ServerSocketReadHandler.java:260)+
+ at com.evermind.util.ReleasableResourcePooledExecutor$MyWorker.run(ReleasableResourcePooledExecutor.java:303)+
+ at java.lang.Thread.run(Thread.java:595)+
+Caused by: Exception [TOPLINK-4002] (Oracle TopLink - 11g Release 1 (11.1.1.0.0) (Build 080319)): oracle.toplink.exceptions.DatabaseException+
Internal Exception: java.sql.SQLException: ORA-00904: "SEQ_NAME": invalid identifier
Error Code: 904
Call: UPDATE SEQUENCE SET SEQ_COUNT = SEQ_COUNT 50 WHERE SEQ_NAME = 'JOB_ID_SEQ'+
Query: DataModifyQuery()
+ at oracle.toplink.exceptions.DatabaseException.sqlException(DatabaseException.java:296)+
+ at oracle.toplink.internal.databaseaccess.DatabaseAccessor.executeDirectNoSelect(DatabaseAccessor.java:724)+
+ at oracle.toplink.internal.databaseaccess.DatabaseAccessor.executeNoSelect(DatabaseAccessor.java:790)+
+ at oracle.toplink.internal.databaseaccess.DatabaseAccessor.basicExecuteCall(DatabaseAccessor.java:524)+
+ at oracle.toplink.internal.databaseaccess.DatabaseAccessor.executeCall(DatabaseAccessor.java:467)+
+ at oracle.toplink.internal.sessions.AbstractSession.executeCall(AbstractSession.java:795)+
+ at oracle.toplink.internal.queryframework.DatasourceCallQueryMechanism.executeCall(DatasourceCallQueryMechanism.java:193)+
+ at oracle.toplink.internal.queryframework.DatasourceCallQueryMechanism.executeCall(DatasourceCallQueryMechanism.java:179)+
+ at oracle.toplink.internal.queryframework.DatasourceCallQueryMechanism.executeNoSelectCall(DatasourceCallQueryMechanism.java:222)+
+ at oracle.toplink.internal.queryframework.DatasourceCallQueryMechanism.executeNoSelect(DatasourceCallQueryMechanism.java:202)+
+ at oracle.toplink.queryframework.DataModifyQuery.executeDatabaseQuery(DataModifyQuery.java:55)+
+ at oracle.toplink.queryframework.DatabaseQuery.execute(DatabaseQuery.java:671)+
+ at oracle.toplink.internal.sessions.AbstractSession.internalExecuteQuery(AbstractSession.java:2260)+
+ at oracle.toplink.internal.sessions.AbstractSession.executeQuery(AbstractSession.java:1074)+
+ at oracle.toplink.internal.sessions.AbstractSession.executeQuery(AbstractSession.java:1058)+
+ at oracle.toplink.internal.sessions.AbstractSession.executeQuery(AbstractSession.java:1032)+
+ at oracle.toplink.sequencing.QuerySequence.update(QuerySequence.java:319)+
+ at oracle.toplink.sequencing.QuerySequence.updateAndSelectSequence(QuerySequence.java:258)+
+ at oracle.toplink.sequencing.StandardSequence.getGeneratedVector(StandardSequence.java:62)+
+ at oracle.toplink.sequencing.DefaultSequence.getGeneratedVector(DefaultSequence.java:144)+
+ at oracle.toplink.sequencing.Sequence.getGeneratedVector(Sequence.java:256)+
+ at oracle.toplink.internal.sequencing.SequencingManager$Preallocation_Transaction_NoAccessor_State.getNextValue(SequencingManager.java:444)+
+ at oracle.toplink.internal.sequencing.SequencingManager.getNextValue(SequencingManager.java:873)+
+ at oracle.toplink.internal.sequencing.ClientSessionSequencing.getNextValue(ClientSessionSequencing.java:75)+
+ at oracle.toplink.internal.descriptors.ObjectBuilder.assignSequenceNumber(ObjectBuilder.java:234)+
+ at oracle.toplink.internal.sessions.UnitOfWorkImpl.assignSequenceNumbers(UnitOfWorkImpl.java:419)+
+ at oracle.toplink.internal.sessions.UnitOfWorkImpl.calculateChanges(UnitOfWorkImpl.java:497)+
+ at oracle.toplink.internal.sessions.UnitOfWorkImpl.commitToDatabaseWithChangeSet(UnitOfWorkImpl.java:1407)+
+ at oracle.toplink.internal.sessions.UnitOfWorkImpl.commitRootUnitOfWork(UnitOfWorkImpl.java:1167)+
+ at oracle.toplink.internal.sessions.UnitOfWorkImpl.commit(UnitOfWorkImpl.java:939)+
+ at oracle.apps.xdo.servlet.scheduler.toplink.ToplinkDataHandler.insertJob(ToplinkDataHandler.java:815)+
+ ... 16 more+
Caused by: java.sql.SQLException: ORA-00904: "SEQ_NAME": invalid identifier
+ at oracle.jdbc.driver.DatabaseError.throwSqlException(DatabaseError.java:138)+
+ 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_rows(T4CStatement.java:561)+
+ at oracle.jdbc.driver.OracleStatement.doExecuteWithTimeout(OracleStatement.java:1161)+
+ at oracle.jdbc.driver.OracleStatement.executeUpdate(OracleStatement.java:1585)+
+ at oracle.toplink.internal.databaseaccess.DatabaseAccessor.executeDirectNoSelect(DatabaseAccessor.java:713)+
+ ... 45 more+
Found a thread related to this but there it was explained that the error was occuring when trying to notify regarding output through email. In our case, issue is occuring just during scheduling itslef.
Also I haved checked the following schedular tables in my database.
SQL> select table_name from all_tables where table_name like 'S_NQ%'
+2 /+
TABLE_NAME
S_NQ_ERR_MSG
S_NQ_INSTANCE
S_NQ_JOB_PARAM
S_NQ_JOB
SQL> select SEQ_NAME.CURRVAL FROM DUAL;
select SEQ_NAME.CURRVAL FROM DUAL
*+
ERROR at line 1:
ORA-02289: sequence does not exist
Please help me out in solving this as I have tried almost all possible solutions.
Thanks,
Sri Harsha.
Edited by: user10545574 on Dec 20, 2009 10:24 PMHello,
In the delivery email configuration server page (under BI Publisher Admin Tab), the username / password to enter is the one defined on the email server itself. It is the user that will be user to send the emails when scedhuling a report.
It may not be Administrator/ Administrator (not a user defined with OBI admin tool) but the username/password defined on the email server itself.
Moreover, to properly configure the BI Publisher Scheduler, it is a prerequistes to create bipsched user on Oracle DB and install the schema tables in Oracle DB (by clicking on Install Schema button after defining database connection under Admin / Scheduler Configuration tab)
From the error your are getting 'SEQ_NAME unknown..., it appears that the tables are not created'.
Hope this helps and good luck
Matthieu -
Dynamic SQL Issue ORA-00904:invalid identifier error
Here is my SP
create or replace procedure srini_ref_cursor_test(p_county_code IN VARCHAR2,
p_ref_cur out PK_FR_TYPES.cursor_type) is
query_str varchar2(5000);
begin
query_str := 'SELECT * FROM dw_county where county_name = :P ';
open p_ref_cur for query_str USING p_county_code;
insert into srini_query_str_test values (query_str);
commit;
end srini_ref_cursor_test;
When I pass the p_county_code = Adams working find.
create or replace procedure srini_ref_cursor_test(p_county_code IN VARCHAR2,
p_ref_cur out PK_FR_TYPES.cursor_type) is
query_str varchar2(5000);
begin
query_str := 'SELECT * FROM dw_county where county_name in ('||p_county_code||')';
open p_ref_cur for query_str;
insert into srini_query_str_test values (query_str);
commit;
end srini_ref_cursor_test;
When I pass the p_county_code = Adams for above SP I got the following error
ORA-00904: "ADAMS": invalid identifier error
With out Bind variables how Can I pass the Char type values in Dynamic SQL ?
I would like to pass multipule values to p_county_code like 'Adams','Ashley' etc
How Can I do this ?
Thank for great help.
SriniHow do I write the Dynamic SQL for
SELECT * FROM DW_COUNTY WHERE COUNTY_NAME LIKE 'Ad%'
The usual way...
hr@ORA10G>
hr@ORA10G> var str varchar2(1000);
hr@ORA10G> var cr refcursor;
hr@ORA10G>
hr@ORA10G> exec :str := 'select * from employees where first_name like ''A%''';
PL/SQL procedure successfully completed.
hr@ORA10G> -- note the escape character for each single quote
hr@ORA10G> print str
STR
select * from employees where first_name like 'A%'
hr@ORA10G>
hr@ORA10G> exec open :cr for :str;
PL/SQL procedure successfully completed.
hr@ORA10G> print cr
EMPLOYEE_ID FIRST_NAME LAST_NAME EMAIL PHONE_NUMBER HIRE_DATE JOB_ID SALARY COMMISSION_PCT MANAGER_ID DEPARTMENT_ID
103 Alexander Hunold AHUNOLD 590.423.4567 03-JAN-90 IT_PROG 9000 102 60
115 Alexander Khoo AKHOO 515.127.4562 18-MAY-95 PU_CLERK 3100 114 30
121 Adam Fripp AFRIPP 650.123.2234 10-APR-97 ST_MAN 8200 100 50
147 Alberto Errazuriz AERRAZUR 011.44.1344.429278 10-MAR-97 SA_MAN 12000 .3 100 80
158 Allan McEwen AMCEWEN 011.44.1345.829268 01-AUG-96 SA_REP 9000 .35 146 80
167 Amit Banda ABANDA 011.44.1346.729268 21-APR-00 SA_REP 6200 .1 147 80
175 Alyssa Hutton AHUTTON 011.44.1644.429266 19-MAR-97 SA_REP 8800 .25 149 80
185 Alexis Bull ABULL 650.509.2876 20-FEB-97 SH_CLERK 4100 121 50
187 Anthony Cabrio ACABRIO 650.509.4876 07-FEB-99 SH_CLERK 3000 121 50
196 Alana Walsh AWALSH 650.507.9811 24-APR-98 SH_CLERK 3100 124 50
10 rows selected.
hr@ORA10G>
hr@ORA10G>pratz -
Dynamic SQL Error -ORA-00904: invalid identifier
Hello!
I'm really hoping I can get some fast help on this. In the interest of honesty, this is for a university oracle programming assignment. I've searched everywhere I can for the answer and haven't had any luck.
Anyway, the problem in a nutshell. I have to write a package to write a text file. The formatting information for the file is held in a table, which has columns to define the various characteristics like justification, padding character and field value.
RECORDTYPE FIELDNAME FIELDVALUE FIELDSIZE FIELDORDER PADDINGCHAR JUSTIFICATION DATASOURCE
7 CreditTotal v_credit 10 5 '0' LPAD PROGRAM
7 RecordType '7' 1 1 ' ' RPAD HARDCODE
I can build the whole file except this footer. the FieldValue "v_credit" references a variable that has the calculated total of the credit amounts for the file. There are also "v_debit", and "(v_credit-v_debt)" entries.
My question seems simple... How can I use this VARCHAR2 value from the table, and have it reference the variable within a Dynamic SQL string? If I use the textvalue of the column in the SQL string it gives me the invalid identifier error when it hits the EXECUTE IMMEDIATE statement. There is another row for the header which has "to_char(sysdate,'DDMMYYYY')" in it, and that runs fine. I'm assuming because they are native SQL statements and variables.
I have tried encapsulating the v_credit in "s, and using dynamica bind variables but had the same problem passing the names to the USING clause.
The SQL string created by the procedure is: SELECT LPAD(v_credit,10,'0' ) FROM dual
The full error is:
ORA-00904: "V_CREDIT": invalid identifier
ORA-06512: at "BWOOD.PKG_BRIAN", line 108
ORA-06512: at line 2
Line 108 is the EXECUTE IMMEDIATE statement
I would really appreciate someones help! I'm happy to post the procedure I've written, with the caveat that it's sloppy student work and needs cleaning up of all the experimental commented attempts:)
Edited by: user5426606 on 20-May-2009 03:34 - Added a few more facts.Thank you for the fast replies. I'll post a short chunk of code to demonstrate.
The actual procedure is quite a bit longer, but this should give you the idea.
PROCEDURE build_dbfile (p_settlement_date IN DATE, p_settlement_key IN VARCHAR2, p_type IN VARCHAR2) AS
v_sqlString VARCHAR2(4000) := 'SELECT ';
v_rectype NUMBER := 7;
v_line LONG;
v_debit NUMBER := 0;
v_credit NUMBER := 0;
v_nrRecords NUMBER := 0;
CURSOR c_settlement IS... -- to select records for data rows
-- cursor to select the rows with the file formatting and data info
CURSOR c_header IS SELECT NVL(fieldvalue,fieldname) db_field, <---- selects the data column
fieldsize,
NVL(paddingchar, ''' ''') paddingchar,
NVL(justification,'LPAD') justification,
datasource
FROM FSS_DESKBANK_REF
WHERE recordtype = r_rec_types.recordtype
ORDER BY recordType, fieldorder;
-- SELECT to get the SUM of datarows for v_credit
SELECT SUM(transactionamount)
INTO v_credit...
-- SELECT to get the SUM of datarows for v_debit
SELECT SUM(transactionamount)
INTO v_debit....
FOR r_head IN c_header LOOP
v_sqlString := v_sqlString || r_head.justification|| '('
|| r_head.db_field ||','
|| r_head.fieldsize || ','
|| r_head.paddingchar || ')';
v_sqlString := v_sqlString || ' FROM ' || v_tbl_name;
DBMS_OUTPUT.PUT_LINE('SQL --> '||v_sqlString);
EXECUTE IMMEDIATE v_sqlString INTO v_line;
END LOOP;
DBMS_OUTPUT.PUT_LINE(v_line);
END build_dbfile;So the loop goes through the table rows, grabs each data value and formatting column, and builds the sql string, which is then passed to the execute statement. The issue is the ones where the datarow contains a reference to v_credit, and the error is generated. ie r_head.db_field contains the string "v_credit"
Satish, the sql does look like that in the string, but the string is built from the table, not hardcoded. ie v_sqlString = "SELECT LPAD(v_credit,10,'0' ) FROM dual" when it is passed to the EXECUTE IMMEDIATE.
Edited by: user5426606 on 20-May-2009 05:19 -
Hi
I am trying insert rows in Oracle database using JDBC receiver adapter setup in PI 7.1. However this receiver adapter is throwing following exception.
Delivering the message to the application using connection JDBC_http://sap.com/xi/XI/System failed, due to: com.sap.engine.interfaces.messaging.api.exception.MessagingException: Error processing request in sax parser: Error when executing statement for table/stored proc. 'PRADEEP_OTC_ORDERS' (structure 'statement'): java.sql.SQLException: ORA-00904: "BATCH_ID": invalid identifier .
<?xml version="1.0" encoding="UTF-8" ?>
<ns0:mt_sql_writer xmlns:ns0="http://rdbms_poc">
<statement>
<dbtablename action="INSERT">
<table>PRADEEP_OTC_ORDERS</table>
<access>
<order_id>19126</order_id>
<version>1</version>
<batch_id>132</batch_id>
</access>
</dbtablename>
</statement>
</ns0:mt_sql_writer>
PRADEEP_OTC_ORDERS table has just 3 columns as specified the access segment. However I stil get this ORA-00904 error message.
Any idea on what could be wrong.?
Thanks
-PradeepHi All,
Thanks a lot for responding...
I verified the table structure, table just contains those 3 coulms all varchar type.
I modified the column name as well, But was still getting ORA-00904. Then I went directly to the the database and executed below insert statement,
insert into PRADEEP_OTC_ORDERS (mps_order_id, mps_version,mps_batch_id) Values(1,2,3)
I got exact SQL Error: ORA-00904: "MPS_BATCH_ID": invalid identifier.
So ISAP JDBC adapter is not enclosing the string values in quotes.
SAP documentation says it puts quotes for values and treats everything as string(text).
Anybody has any idea, why JDBC receiver adapter not enclosing the values in quotes?
Thanks
-Pradeep -
Hibernate generated SQL produces ORA-00904
I am using Hibernate to do the O/R-mapping in my application. One of my HQL queries is translated into a SQL query which produces an ORA-00904.
I have tracked down the problem to a simple SQL example:
create table a (b integer, c integer);
create table d (b integer, e integer);
create table f (c integer, g integer);
select *
from a, d
inner join f on a.c = f.c
where a.b = d.b;
ORA-00904: "A"."C": invalid identifier
I assumed that table a is visible throughout the whole query, isn't it? I have checked the above select against the documentation of the statement at
http://download-uk.oracle.com/docs/cd/B14117_01/server.101/b10759/statements_10002.htm
and I do not see the problem. Is this a bug in the query parser? We are using 10.1.0.3 on Linux.I am aware, that there are much better ways to write the query but this is the style my O/R-mapping tool is generating a query.
The point is: why is table a not available. If you have a look at the syntax of select:
select := subquery [for_update_clause]
subquery:= ... FROM table_reference [ , table_reference [, table_reference ] ] ...
tablereference:= query_table_expression ... [t_alias] .... | join_clause
query_table_expression:= [schema.] table
join_clause:=[inner_cross_join_claus] | ...
inner_cross_join_claus:=table_reference [inner] JOIN table_reference ON condition | ...
I just outlined the interesting parts of the syntax.
Forget the where condition and think of getting a cross product of a and d but joining table f on a.
Nowhere is stated, that i can not use an table or alias onto that table generated in the first table_reference in the a condition of an additional join. -
Oracle query on dblinked SQL Server tables returns ORA-00904 error
Hi,
I have created a dblink to a SQL Server database from Oracle using Generic Connectivity.
The following query returns ORA-00904 Invalid Identifier error in the WHERE clause (tblEmp.Empno)
SELECT "EmpNo","EmpName", "DeptName"
FROM tblEmp@sqlserver,
tblDept@sqlserver
WHERE tblDept.DeptNo = tblEmp.Empno
I had to enclose the column names in double quotes due to case sensitivitiy of the columns, but I can't do the
same for the WHERE clause.
1) So, how do I fix this error ?
2) Also how do I include Deptno column with table alias in the columns list?
(Deptno is ambiguous in Emp and Dept tables)
Regards,
SamAlex
Because using the aliases all the time can become annoying and lead to disparate standards when used by multiple developers. For a one-off query I would go with aliases in the query but if the linked tables are going to be interrogated extensively I would prefer to create vanilla views of the underlying tables so that the aliases aren't necessary.
Just my opinion, it feels a bit cleaner to do it this way - you only do the work once in creating the view and then you don't need to worry about the case sensitivity of the linked database. You can also refer to the source in the name of the view so you don't have to think about different source databases with the same table names.
Cheers
Ben -
ORA-00904 ON A PLSQL QUERY RETURNING SQL QUERY ( NOT ALWAYS )
Running a classic report , we sometimes face the error :
<pre>failed to parse SQL query:
ORA-00904: : invalid identifier
Even when using the same parameters, sometimes the report runs and some others we get the error.
The report is called by a url from a different page
f?p=&APP_ID.:500:&APP_SESSION.:FLOW_EXCEL_OUTPUT_R&P503_RUN_REGION_ID._el:NO::P500_RUN_RG,P500_RG11_FILTER1:1,&P503_FILTER1.
THE EVNVIRONMENT IS THE FOLLOWING
ORACLE DATABASE 11g Enterprise Edition Release 11.2.0.2.0 -64bit
Apex Application Express 4.1.0.00.32
In the apex on the same workspace we have 2 copies of the same application having different schema.
We did not face this problem in Oracle 10g
hello,
I send you the function. rs_check_limit .
In one case when i tried to debug in order to understand the error, the function was not fired.
FUNCTION rs_check_limit ( p_trade_date_from date
, p_trade_date_to date, p_session_id number , p_user_id varchar2
, p_pct_sum_prcp_cd number
,p_rs_list_exclude varchar2 default ' '
return rs_check_limit_tb PIPELINED
is
v_data rs_check_limit_tp :=rs_check_limit_tp ( null, null,null, null,null, null,null, null,null, null );
CURSOR exec_trades_prcp_cur (vc_risk_date_from date
, vc_risk_date_to date
, vc_rs_list_exclude varchar2
is
select PRCP_CD
, clr_sys_cd
, clr_acc_cd
,avg( exec_trades_value_mkt ) avg_exec_trades_prcp
,SUM( exec_trades_value_mkt ) sum_exec_trades_prcp
from
select trd_dt, PRCP_CD , clr_sys_cd
, clr_acc_cd , sum ( exec_trades_value_mkt ) exec_trades_value_mkt
from
select lst_cmpt_dt trd_dt , PRCP_CD , clr_sys_cd
, clr_acc_cd
,SUM (BUYS_VALUE+ SELLS_VALUE) exec_trades_value_mkt
from rs_mm_rsk_lmts_dtls
where 1=1
and lst_cmpt_dt > vc_risk_date_from -1
and lst_cmpt_dt <= vc_risk_date_to
and instr( vc_rs_list_exclude, TRIM(clr_acc_cd)|| '.')= 0
group by lst_cmpt_dt , PRCP_CD , clr_sys_cd
, clr_acc_cd
UNION ALL
select trunc ( apx_rs_risk_info.get_d_n_cur (lst_cmpt_dt,- 1) ) trd_dt , PRCP_CD , clr_sys_cd
, clr_acc_cd, SUM (BUYS_VALUE+ SELLS_VALUE) exec_trades_value_mkt
from rs_mm_rsk_lmts_dtls
where trd_dt = apx_rs_risk_info.get_d_n_cur ( lst_cmpt_dt , 2 )
and lst_cmpt_dt > apx_rs_risk_info.get_d_n_cur (vc_risk_date_from ,1 )-1
and lst_cmpt_dt < vc_risk_date_to
and instr( vc_rs_list_exclude, TRIM(clr_acc_cd)|| '.')= 0
group by apx_rs_risk_info.get_d_n_cur (lst_cmpt_dt , -1 ) ,PRCP_CD , clr_sys_cd
, clr_acc_cd
group by trd_dt, PRCP_CD , clr_sys_cd
, clr_acc_cd
group by PRCP_CD , clr_sys_cd
, clr_acc_cd
CURSOR exec_trades_all_cur (vc_risk_date_from date
, vc_risk_date_to date
, vc_rs_list_exclude varchar2)
is
select SUM( exec_trades_value_mkt ) sum_exec_trades_all -- óõíïëéêÞ çìåñÞóéá áîßá óõíáëëáãùí áãïñÜò
, avg( exec_trades_value_mkt ) avg_exec_trades_all
from
select trd_dt, sum( exec_trades_value_mkt ) exec_trades_value_mkt
from
--gia T : T, T-1 , T-2
select lst_cmpt_dt trd_dt , SUM (BUYS_VALUE+ SELLS_VALUE) exec_trades_value_mkt
from rs_mm_rsk_lmts_dtls
where 1=1
and lst_cmpt_dt > vc_risk_date_from -1
and lst_cmpt_dt <= vc_risk_date_to
and instr( vc_rs_list_exclude, TRIM(clr_acc_cd)|| '.')= 0
group by lst_cmpt_dt
union all
--gia T EPIPLEON: T-3
select apx_rs_risk_info.get_d_n_cur (lst_cmpt_dt,-1) trd_dt , SUM (BUYS_VALUE+ SELLS_VALUE) exec_trades_value_mkt
from rs_mm_rsk_lmts_dtls
where trd_dt = apx_rs_risk_info.get_d_n_cur ( trunc ( lst_cmpt_dt ) , +2 )
and lst_cmpt_dt > apx_rs_risk_info.get_d_n_cur (vc_risk_date_from ,1 )-1
and lst_cmpt_dt < vc_risk_date_to
and instr( vc_rs_list_exclude, TRIM(clr_acc_cd)|| '.')= 0
group by apx_rs_risk_info.get_d_n_cur (lst_cmpt_dt , -1 )
group by trd_dt
exec_trades_prcp_row exec_trades_prcp_cur%rowtype;
exec_trades_all_row exec_trades_all_cur%rowtype;
i number := 0;
tmp varchar2(4) := null;
procedure feed_table is
BEGIN
v_data.prcp_cd := exec_trades_prcp_row.prcp_cd;
v_data.clr_sys_cd := exec_trades_prcp_row.clr_sys_cd;
v_data.clr_acc_cd := trim(exec_trades_prcp_row.clr_acc_cd);
v_data.member_id := RS_GET_PRCP_MEMBER_ID(exec_trades_prcp_row.prcp_cd);
v_data.member_dsc := RS_GET_PRCP_DSC(exec_trades_prcp_row.prcp_cd);
v_data.sumTRADES_VALUE_PRCP_CD_T := round( exec_trades_prcp_row.sum_exec_trades_prcp,2);
v_data.mkt_sumTRADES_VALUE_PRCP_CD_T := round( exec_trades_all_row.sum_exec_trades_all,2) ;
v_data.avgTRADES_VALUE_PRCP_CD_T := round( exec_trades_prcp_row.avg_exec_trades_prcp,2);
v_data.mkt_avgTRADES_VALUE_PRCP_CD_T := round( exec_trades_all_row.avg_exec_trades_all,2) ;
v_data.pct_sum_prcp_cd := round( 100* exec_trades_prcp_row.sum_exec_trades_prcp
/ exec_trades_all_row.sum_exec_trades_all , 2);
end ;
begin
exec_trades_all_row := null;
open exec_trades_all_cur (vc_risk_date_from => p_trade_date_from
, vc_risk_date_to => p_trade_date_to
,vc_rs_list_exclude => NVL(p_rs_list_exclude ,'.' )
fetch exec_trades_all_cur INTO exec_trades_all_row;
close exec_trades_all_cur;
for exec_trades_prcp_rec in exec_trades_prcp_cur (vc_risk_date_from => p_trade_date_from
, vc_risk_date_to => p_trade_date_to
,vc_rs_list_exclude => NVL(p_rs_list_exclude ,'.' )
loop
exec_trades_prcp_row := exec_trades_prcp_rec;
if exec_trades_all_row.sum_exec_trades_all <> 0 then
if 100* exec_trades_prcp_row.sum_exec_trades_prcp
/ exec_trades_all_row.sum_exec_trades_all >= p_pct_sum_prcp_cd then
i := i+1;
v_data :=rs_check_limit_tp ( null, null,null, null,null, null,null, null,null, null );
feed_table;
pipe row ( v_data );
end if;
end if;
end loop;
end;
I send you the dll for the type
CREATE OR REPLACE
TYPE rs_check_limit_tp as object
prcp_cd varchar2(10)
, member_id varchar2(4)
, member_dsc varchar2(120)
, clr_sys_cd varchar2(4)
, clr_acc_cd varchar2(6)
, avgTRADES_VALUE_PRCP_CD_T number
, mkt_avgTRADES_VALUE_PRCP_CD_T number
, sumTRADES_VALUE_PRCP_CD_T number
, mkt_sumTRADES_VALUE_PRCP_CD_T number
, pct_sum_prcp_cd number
and the table dll
CREATE TABLE rs_mm_rsk_lmts_dtls
(trd_dt DATE NOT NULL,
prcp_cd VARCHAR2(10 BYTE) NOT NULL,
clr_sys_cd CHAR(4 BYTE),
clr_acc_cd CHAR(10 BYTE),
sec_isin_cd VARCHAR2(12 BYTE) NOT NULL,
buys NUMBER(19,0),
sells NUMBER(19,0),
buys_value NUMBER(19,6),
sells_value NUMBER(19,6),
abs_b_minus_s NUMBER(19,2),
rsk_prc NUMBER(13,6),
net_value NUMBER(19,2) NOT NULL,
sr NUMBER(19,2) NOT NULL,
mm NUMBER(19,2) NOT NULL,
lst_cmpt_dt DATE,
usr_id VARCHAR2(8 BYTE) NOT NULL,
cmt VARCHAR2(64 BYTE),
chg_dt DATE,
gr_b NUMBER(19,2) NOT NULL,
gr_s NUMBER(19,2) NOT NULL)
Thank you
Tonia -
I had to refresh my view to the latest label. After I did the ade refresh -latest, I got this label:
FMWTOOLS_11.1.1.6.0_GENERIC_120112.0037.2_PATCHES4FA_11.1.1.6.2_PLATFORMS
this label also updated the JDeveloper to 11.1.1.6. I was using before 11.1.5.
The problem is that now I cannot run composites that were running with no issues before the upgrade.
This error is shown in the console after starting the SOA server, without even trying to run anything at all.
soa_server1] [ERROR] [] [oracle.soa.mediator.common.listener] [tid: Workmanager: , Version: 0, Scheduled=false, Started=false, Wait time: 0 ms\n] [ecid: 889cfef60875ddb5:-530c4ecd:135e2d7308b:-8000-0000000000000003,0] [APP: soa-infra] DBLocker caught exception while retrieving locked messages. Will retry retrieval after 2 seconds[[
Local Exception Stack:
Exception [TOPLINK-4002] (Oracle TopLink - 11g Release 1 (11.1.1.6.0) (Build 111018)): oracle.toplink.exceptions.DatabaseException
Internal Exception: java.sql.SQLSyntaxErrorException: ORA-00904: "TENANT_ID": invalid identifier
Error Code: 904
Call: SELECT CASE_ID, CONTAINER_ID, DUMMY1, MSG_ID, COMPONENT_DN, OPERATION, CREATION_DATE, PRIORITY, COMPONENT_STATUS, QNAME_LOCAL_PART, CASE_INFO, QNAME_NAMESPACE, LOCK_TIME, SOURCE_URI, TENANT_ID, INSTANCE_CREATED, IS_EVENT, STATUS FROM MEDIATOR_DEFERRED_MESSAGE WHERE (((STATUS = ?) AND (LOCK_TIME = ?)) AND (CONTAINER_ID = ?))
bind => [1, 2012-03-05 04:59:22.978, 56B16AC166BF11E1AF4DC30F777D0670]
Query: ReadAllQuery(oracle.tip.mediator.common.persistence.MediatorDeferredMessage)
at oracle.toplink.exceptions.DatabaseException.sqlException
My environment:
is a VM with Linux
I am using the standalone weblogic
running SOA composites.
Is this a Database Issue?
Any help would be appreciated.
Thanks
Edited by: user721265 on Mar 9, 2012 5:00 AMHi,
Try to create the column as:
ALTER TABLE MEDIATOR_DEFERRED_MESSAGE
ADD (TENANT_ID NUMBER(18, 0) DEFAULT -1 );
The RCU does not create that column. There are two more tables that "should have" that column (or even more? ): COMPOSITE_INSTANCE and CUBE_INSTANCE.
Check this site:
http://www.oracle.com/technetwork/database/availability/oraclefmw-soa-11gr1-securefiles-1842740.pdf
Regards,
AAPDL
Maybe you are looking for
-
In Photoshop 9 can I view or sort photos by time taken not just by date taken?
-
Hi, I just opened up my brand new 30" ACD. I noticed that the foam packing was broken on one side, indicating that it had been handled a bit roughly in shipping. However, the display seems to be OK. The only problem is the hinge on the stand. My olde
-
I am trying to think up a way of creating a report that would show devices that MARS hasnt received a log from in X days. I ran a report for all devices with the reporting devices ranked by session, and I noticed about 20 of my devices were not on th
-
Columns in Admin Tool are re-ordering
Not sure what is causing this but it might be related to my Logical dimension-fact table relationships. I will order columns in the Presentation layer or the BI Administrator Tool within folders and randomly the columns will re-organize and be sorted
-
Hi Friends For triggering an idoc for delivery confirmation, we are using output type in the delivery document.The partner number for the output type in the delivery document has not been assigned to any outbound parameters or message control in WE20