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
Solved

ORA-00904 Error (need help)

Posted on 2004-09-13
5
2,049 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
TypeError: Users.save is not a function 3 60
Service Catalogue and Data Migration doc 3 54
T-SQL: Do I need CLUSTERED here? 13 59
corrupt Databases 9 65
This article describes some very basic things about SQL Server filegroups.
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…

839 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