Solved

ORA-00904 Error (need help)

Posted on 2004-09-13
5
2,046 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

Netscaler Common Configuration How To guides

If you use NetScaler you will want to see these guides. The NetScaler How To Guides show administrators how to get NetScaler up and configured by providing instructions for common scenarios and some not so common ones.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
What is ISQL? 6 125
select query - oracle 16 94
Determine next b-weekly date 12 80
Hi,İ want to find month which its name have 4 letter.Ex:June,July (in SQL Server 2014) 2 56
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…
Never store passwords in plain text or just their hash: it seems a no-brainier, but there are still plenty of people doing that. I present the why and how on this subject, offering my own real life solution that you can implement right away, bringin…
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…

920 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

14 Experts available now in Live!

Get 1:1 Help Now