Solved

ORA-00904 Error (need help)

Posted on 2004-09-13
5
2,042 Views
Last Modified: 2012-06-27
I am receiving a PL/SQL: ORA-00904: "DOCREF": invalid identifier am not sure why.  Can someone provide guidance?
-------------------------------------------------------------------------------------------------------------------------
This is my source code -

CREATE OR REPLACE PROCEDURE Sp_Sel_Xmldoc(iNODEID IN NUMBER, iDOCTYPE IN VARCHAR2, iDOCREF IN NUMBER,
         oxmldata OUT sys.XMLTYPE)

AS

V_NODEID NUMBER(10);
V_DOCTYPE VARCHAR2(20);
V_DOCREF NUMBER(10);
V_XMLDATA  sys.XMLTYPE;

BEGIN

V_NODEID             := iNODEID;
V_DOCTYPE          := iDOCTYPE;
V_DOCREF            := iDOCREF;

SELECT XMLDOC INTO (V_XMLDATA)
FROM NODALXML

WHERE nodeid = V_NODEID
AND doctype = V_DOCTYPE
AND docref = V_DOCREF;

END;
/

The oracle table looks like this -

CREATE TABLE PRISM.NODALXML
(
  NODALXML_PK  NUMBER(10),
  NODEID       NUMBER(10),
  DOCTYPE      VARCHAR2(20 BYTE),
  DOCREF       NUMBER(10),
  XMLDOC       SYS.XMLTYPE
)

Thanks.
0
Comment
Question by:john1953
5 Comments
 
LVL 11

Expert Comment

by:cjjclifford
ID: 12045751
hi,

is the "CREATE TABLE PRISM.NODALXL" statement correct?

DOCTYPE VARCHAR2(20 BYTE) ????

I would guess this is supposed to be "DOCTYPE VARCHAR2(20)"...
0
 
LVL 11

Assisted Solution

by:cjjclifford
cjjclifford earned 100 total points
ID: 12045760
sorry, that CREATE TABLE looks ok...
0
 
LVL 22

Accepted Solution

by:
Helena Marková earned 100 total points
ID: 12051580
Maybe you can try this:

CREATE OR REPLACE PROCEDURE Sp_Sel_Xmldoc(iNODEID IN NUMBER, iDOCTYPE IN VARCHAR2, iDOCREF IN NUMBER,
         oxmldata OUT sys.XMLTYPE)
AS

 p_1   NODALXML.XMLDOC%TYPE;

BEGIN

SELECT p.XMLDOC INTO p_1
FROM NODALXML p
WHERE p.nodeid =iNODEID AND p.doctype =iDOCTYPE AND docref = iDOCREF;

END;
/
0
 
LVL 7

Assisted Solution

by:BobMc
BobMc earned 100 total points
ID: 12056185
Seems to work fine for me (9204) - is the procedure in the same schema as the table?
0
 
LVL 15

Expert Comment

by:Aaron Shilo
ID: 12337023
you should use the oxmldata OUT sys.XML%TYPE

the '%' is needed for a referencial datatype
0

Featured Post

Highfive Gives IT Their Time Back

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

Database tuning – How to start and what to tune. This question is frequently asked by many people, both online and offline. There is no hard and fast rule-of-thumb for performance tuning, however, before beginning the tuning process one should a…
Entity Framework is a powerful tool to help you interact with the DataBase but still doesn't help much when we have a Stored Procedure that returns more than one resultset. The solution takes some of out-of-the-box thinking; read on!
Video by: Steve
Using examples as well as descriptions, step through each of the common simple join types, explaining differences in syntax, differences in expected outputs and showing how the queries run along with the actual outputs based upon a simple set of dem…
Polish reports in Access so they look terrific. Take yourself to another level. Equations, Back Color, Alternate Back Color. Write easy VBA Code. Tighten space to use less pages. Launch report from a menu, considering criteria only when it is filled…

760 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

20 Experts available now in Live!

Get 1:1 Help Now