Solved

ORA-00904 Error (need help)

Posted on 2004-09-13
5
2,058 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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

Enroll in June's Course of the Month

June's Course of the Month is now available! Every 10 seconds, a consumer gets hit with ransomware. Refresh your knowledge of ransomware best practices by enrolling in this month's complimentary course for Premium Members, Team Accounts, and Qualified Experts.

Question has a verified solution.

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

Many companies are looking to get out of the datacenter business and to services like Microsoft Azure to provide Infrastructure as a Service (IaaS) solutions for legacy client server workloads, rather than continuing to make capital investments in h…
Your data is at risk. Probably more today that at any other time in history. There are simply more people with more access to the Web with bad intentions.
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…
This is a high-level webinar that covers the history of enterprise open source database use. It addresses both the advantages companies see in using open source database technologies, as well as the fears and reservations they might have. In this…

687 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