Ora-30625/xmltype
Hi!
I got this error; ORA-30625: method dispatch on NULL SELF argument is disallowed,
when I tried to do next:
declare
xml_lukio xmltype;
s1_k1 varchar2(60);
select v.lukio_doc into xml_lukio
from vp_lukiopohja v
where koulutus=1;
s1_k1:=xml_lukio.extract('/valintapisteytys/arvosanat/sarake1/kentta1/text()').getstringval();
And this is what lukio_doc includes:
<valintapisteytys xmlns="http://vp_skeemat/vp_skeema.xsd"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://vp_skeemat/vp_skeema.xsd
http://vp_skeemat/vp_skeema.xsd">
<arvosanat>
<sarake1>
<kentta1>Yo-todistus</kentta1>
<kentta2>Lukion päättötodistus</kentta2>
<kentta3>Lukion päättötodistuksen keskiarvo</kentta3>
</sarake1>
</arvosanat>
</valintapisteytys>
This worked earlier, when it did not include xml schema.
So what's wrong?
s1_k1:=xml_lukio.extract('/valintapisteytys/arvosanat/sarake1/kentta1/text()').getstringval();
1. extract returns an XMLType. You are then invoking getStringVal on the XMLType returned by extract. If extract returns null you will get the error you are reported.
2. Your Schema uses a lot of namespaces.
<valintapisteytys xmlns="http://vp_skeemat/vp_skeema.xsd"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://vp_skeemat/vp_skeema.xsd
http://vp_skeemat/vp_skeema.xsd">
You need to pass these namespaces as a third argument to extract...
s1_k1:=xml_lukio.extract
('/valintapisteytys/arvosanat/sarake1/kentta1/text()',xmlns="http://vp_skeemat/vp_skeema.xsd"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://vp_skeemat/vp_skeema.xsd
http://vp_skeemat/vp_skeema.xsd"').getstringval();
Similar Messages
-
every time when I run function GET_PURCHASEORDER_VALUE Oracle rises error ora-30625 in line*. I work in Oracle release 9.0.1.3.0. what shuld I do? help me. please.
create or replace function GET_PURCHASEORDER_VALUE(PURCHASEORDER in sys.XMLTYPE)
return number is
LINEITEMS sys.XMLTYPE;
LINEITEM sys.XMLTYPE;
COST number;
QUANTITY number;
TOTAL number := 0;
I binary_integer := 1;
begin
LINEITEMS := PURCHASEORDER.extract('//LineItem'); *
loop
LINEITEM := LINEITEMS.extract('/LineItem['||I||']');
exit when LINEITEM is null;
COST := LINEITEM.extract('/LineItem/Part/@UnitPrice').getNumberVal();
QUANTITY := LINEITEM.extract('/LineItem/Part/@Quantity').getNumberVal();
TOTAL := TOTAL + (COST * QUANTITY );
I := I + 1;
end loop;
return TOTAL;
end GET_PURCHASEORDER_VALUE;
ORA-30625 method dispatch on NULL SELF argument is disallowed9.1.0.3 has limited XPATH support. Can you upgrade to 9.2.0.2?
Can you try extractValue instead of extract? -
I am trying to run a procedure in a package and I keep getting this error
ERROR at line 1:
ORA-30625: method dispatch on NULL SELF argument is disallowed
ORA-06512: at "IXSEMF01.EMF_INTERFACE_PKG", line 7
Here is my package body:
PACKAGE BODY EMF_INTERFACE_PKG
IS
PROCEDURE EMF_LOG_XML_PROC (wefXmlData IN XMLType)
IS
eventId VARCHAR(1024);
BEGIN
eventId := wefXmlData.extract('//ManagementEvent/text()').getStringVal();
INSERT INTO IXSEMF01.EVENT_STORE(EVENT_ID, EVENT_XML)
VALUES (eventId, wefXmlData);
END EMF_LOG_XML_PROC;
END EMF_INTERFACE_PKG;
This is what I am calling:
call EMF_INTERFACE_PKG.EMF_LOG_XML_PROC(XMLType('<ManagementEvent xmlns:muws1="http://docs.oasis-open.org/wsdm/muws1-2.xsd" ReportTime="2007-12-04T10:34:00.000-05:00" xmlns="http://docs.oasis-open.org/wsdm/muws1-2.xsd">
<muws1:EventId>wef://SOASuite/BPEL?eventId=12345</muws1:EventId>
<muws1:SourceComponent>
<muws1:ResourceId>wef://SOASuite/sandbox/BPEL/emf/raiseEventBPEL?instanceId=123456</muws1:ResourceId>
<muws1:ComponentAddress>
<alticor:ManagementURL xmlns:alticor="http://www.alticor.com/extensions">http://lnax30f:8888/BPELConsole</alticor:ManagementURL>
</muws1:ComponentAddress>
</muws1:SourceComponent>
<muws1:ReporterComponent>
<muws1:ResourceId>wef://SOASuite/sandbox/BPEL/emf/raiseEventBPEL?instanceId=123456</muws1:ResourceId>
<muws1:ComponentAddress>
<alticor:ManagementURL xmlns:alticor="http://www.alticor.com/extensions">http://lnax30f:8888/BPELConsole</alticor:ManagementURL>
</muws1:ComponentAddress>
</muws1:ReporterComponent>
<muws2:Situation xmlns:muws2="http://docs.oasis-open.org/wsdm/muws2-2.xsd">
<muws2:SituationCategory>
<muws2:CreateSituation/>
</muws2:SituationCategory>
<muws2:SuccessDisposition>Successful</muws2:SuccessDisposition>
<muws2:Priority>1</muws2:Priority>
<muws2:Severity>1</muws2:Severity>
<muws2:Message>Tihs is a test message</muws2:Message>
<muws2:SubstitutableMsg MsgId="T1" MsgIdType="wef://SOASuite/BPEL/log"/>
</muws2:Situation>
<alticor:ExtendedData xmlns:alticor="http://www.alticor.com/extensions" profile="PurchaseOrderKey"/>
</ManagementEvent>'))
Message was edited by:
IT InternDoes the following return the error when setting l_data or making the call to your procedure?
declare
l_data XMLTYPE;
begin
l_data := XMLType('<ManagementEvent xmlns:muws1="http://docs.oasis-open.org/wsdm/muws1-2.xsd" ReportTime="2007-12-04T10:34:00.000-05:00" xmlns="http://docs.oasis-open.org/wsdm/muws1-2.xsd">
<muws1:EventId>wef://SOASuite/BPEL?eventId=12345</muws1:EventId>
<muws1:SourceComponent>
<muws1:ResourceId>wef://SOASuite/sandbox/BPEL/emf/raiseEventBPEL?instanceId=123456</muws1:ResourceId>
<muws1:ComponentAddress>
<alticor:ManagementURL xmlns:alticor="http://www.alticor.com/extensions">http://lnax30f:8888/BPELConsole</alticor:ManagementURL>
</muws1:ComponentAddress>
</muws1:SourceComponent>
<muws1:ReporterComponent>
<muws1:ResourceId>wef://SOASuite/sandbox/BPEL/emf/raiseEventBPEL?instanceId=123456</muws1:ResourceId>
<muws1:ComponentAddress>
<alticor:ManagementURL xmlns:alticor="http://www.alticor.com/extensions">http://lnax30f:8888/BPELConsole</alticor:ManagementURL>
</muws1:ComponentAddress>
</muws1:ReporterComponent>
<muws2:Situation xmlns:muws2="http://docs.oasis-open.org/wsdm/muws2-2.xsd">
<muws2:SituationCategory>
<muws2:CreateSituation/>
</muws2:SituationCategory>
<muws2:SuccessDisposition>Successful</muws2:SuccessDisposition>
<muws2:Priority>1</muws2:Priority>
<muws2:Severity>1</muws2:Severity>
<muws2:Message>Tihs is a test message</muws2:Message>
<muws2:SubstitutableMsg MsgId="T1" MsgIdType="wef://SOASuite/BPEL/log"/>
</muws2:Situation>
<alticor:ExtendedData xmlns:alticor="http://www.alticor.com/extensions" profile="PurchaseOrderKey"/>
</ManagementEvent>');
EMF_INTERFACE_PKG.EMF_LOG_XML_PROC(l_data);
end; -
Web Service help - ORA-30625: method dispatch on NULL SELF errors
Hi All
I could do with some assistance getting Web service's up & running on my application
I've been following this guide but altering to fit in with our internal web services... the Internet police here at work have youtube blocked off so unable to test end to end using the OTN tutorial
I've created a web service named PASSWORDGEN with the results stored in the collection PASSWORDRESULT
On my page I've created the process that invokes the webservice PASSWORDGEN which is set to run on load - before header - seq #10
then created the pl/sql anonymous block process which is set to run on load - before header - seq #20
I've used the pl/sql example given in the tutorial but substituted their references to collections with my named collection .
declare
l_clob clob;
l_xml xmltype;
l_val clob;
begin
for c1 in (select clob001
from apex_collections
where collection_name = 'PASSWORDRESULT'
) loop
l_clob := c1.clob001;
exit;
end loop;
l_xml := xmltype.createxml(l_clob);
l_val := dbms_xmlgen.convert(l_xml.extract('/methodResponse/params/param/value/string/text()').getclobval(),1);
apex_collection.update_member_attribute(
p_collection_name => 'PASSWORDRESULT',
p_seq => '1',
p_clob_number => '1',
p_clob_value => l_val );
end;
if I try to run the page at this point I get the error ORA-30625: method dispatch on NULL SELF argument is disallowed
what I think is happening, from what I've read up on, is that the collection is empty?
so I'm trying to find out if the web service is not populating the collection correctly or have I made a mistake in the above syntax & trying to reference the collection incorrectly.
Is there a way I can query the collection using TOAD?
Edited by: Mr JD on 21-Jul-2010 08:38ok so found the collection but when I invoke the web service the collection record is not populated. I've tested the webservice & a result is returned but for some reason when I either run the test or run the page which invokes the web service as a page render process the collection is still not populated.....
what I'm I missing here as the setup of the web service is pretty straight forward & testing the web service does produce a result within the test window -
ORA-30625: method dispatch on NULL SELF error
Can Someone help me? I'm new to oracle. I'm writing a procedure to copy a file from my hard drive to oracle. I am getting an error: ORA-30625: method dispatch on NULL SELF argument is disallowed. So I just broke the code down to this little piece. I still get the same error. I created a directory called INPUT_FILE and the file test.jpg is in that directory. What am I missing?
1 Declare
2 imag ordsys.ordimage;
3 ctx raw(4000) :=null;
4 BEGIN
5 imag.setsource('FILE' , 'INPUT_FILE', 'test.jpg');
6 imag.import(ctx);
7* end;
SQL> /
Declare
ERROR at line 1:
ORA-30625: method dispatch on NULL SELF argument is disallowed
ORA-06512: at line 5
nullThere is a sample code for importing an image from an external file into the database in the section 2.2.8 of the interMedia User's Guide:
http://otn.oracle.com/doc/oracle8i_816/inter.816/a67299/mm_uses.htm#601053
Basically, you have to have a table in which you store the image in the database first. -
Hi,
I have created custom insert button in my form and i have written following code on CUSTOM PL/SQL EVENT handler
onINSERT(
p_block_name => p_block_name ,
p_object_name => p_object_name,
p_instance => p_instance ,
p_event_type => p_event_type ,
p_user_args => p_user_args ,
p_session => p_session);
onSuccess(
p_block_name => p_block_name ,
p_object_name => p_object_name,
p_instance => p_instance ,
p_event_type => p_event_type ,
p_user_args => p_user_args ,
p_session => p_session);
When i click on Insert button, i am able to save the record but also i get following error.
ERROR:
ORA-30625: method dispatch on NULL SELF argument is disallowed.
ORA-06512: at "PORTAL30.WWA_AAP_MODULE"
Has anyone comeacross this problem?
Thank you
Shobha
nullI'm getting nearly the same errors running
on portal 3.0.9.
When trying to direct a successful form submission to calling page using
call('','p_back_url');
I get this in apache error log...
ORA-30625: method dispatch on NULL SELF argument is disallowed
ORA-06512: at "PORTALCR.WWA_APP_MODULE", line 42
ORA-06512: at "PORTALCR.WWA_APP_MODULE", line 820
ORA-06501: PL/SQL: program error
ORA-06512: at line 8
This worked in 3.0.6.
The inserts and deletes work fine, I'm just not getting back to the calling page.
Cheers, -
ORA-30625: method dispatch on NULL SELF argument is disallowed (WWV-16016)
I've created a master detail form.
I only want the master record to be read only, as I have a separate form elsewhere that is used to enter all the fields in the table it is based on.
I've hidden the fields in the form that I do not wish the user to see and set the onFocus validation to blur(); to prevent data entry.
The problem is that when a user leaves the master block action to 'None' it produces the error:
ORA-30625: method dispatch on NULL SELF argument is disallowed (WWV-16016)
It runs fine on update mode after a record has been queried.
The table has the correct privs as I already have built a simple form to test inserting records into the master table elsewhere.
Ideally, I want to override the master block action via a bit of coding so to as to stop the user even attempting to create a new record in the master detail form:
p_session.set_value (p_block_name => 'MASTER_BLOCK'
, p_attribute_name => '_MASTER_ACTION'
, p_value => 'NONE');
Any ideas?
cheers,
JohnOracle Portal Version: 10.1.2.0.0 (Build: 290)
DB: 10.1.0.3.1 -
10g ORA-30625: method dispatch on NULL SELF argument is disallowed Options
I found this site for consuming a web service from oracle 9i. I'm trying
it from 10g
http://www.oracle-base.com/articles/9i/ConsumingWebServices9i.php
I have an intranet web service (.NET) I know is working as I use it from
other clients.
But am getting this error when trying the example:
Getting error: ORA-30625: method dispatch on NULL SELF argument is
disallowed.
on this line:
l_fullname := soap_api.get_return_value(p_response => l_response,
p_name => 'yyyResult',
p_namespace =>
'xmlns:ns1="urn:http://www.xxx.net/"');
which calling this in the soap_api package i downloaded and installed
from the stie:
FUNCTION get_return_value(p_response IN OUT NOCOPY t_response,
p_name IN VARCHAR2,
p_namespace IN VARCHAR2)
RETURN VARCHAR2 AS
BEGIN
RETURN p_response.doc.extract('//'||p_name||'/
child::text()',p_namespace).getstringval();
END;
My test script:
declare
l_request soap_api.t_request;
l_response soap_api.t_response;
l_fullname varchar2(50);
BEGIN
l_request := soap_api.new_request(p_method => 'ns1:yyy',
p_namespace =>
'xmlns:ns1="urn:http://www.xxx.net"');
soap_api.add_parameter(p_request => l_request,
p_name => 'userName',
p_type => 'xsd:string',
p_value => 'somestring');
l_response := soap_api.invoke(p_request => l_request,
p_url => 'http://xx.xxx.xx.xx/
securityservice/service.asmx',
p_action => 'http://www.xxx.net/
yyy');
-- failing on the below line(21)
l_fullname := soap_api.get_return_value(p_response => l_response,
p_name => 'yyyResult',
p_namespace =>
'xmlns:ns1="urn:http://www.xxx.net/"');
dbms_output.put_line(l_fullname);
end;
Thanks for any help or information.This rather cryptic message means that the PL/SQL variable or column whose method is being invoked is null.
It's the equivilant of a null pointer exeception in java... -
ORA-30625: method dispatch on NULL SELF argument is disallowed
I have streams setup with table rules.( 3 tiers). It is working fine, besides for one table when insert record, apply has error "ORA-30625: method dispatch on NULL SELF argument is disallowed". I did include all columns in supplemental log group always. Is any limit for max columns for Oracle Streams. This table has 137 columns and I created 6 supplemental log groups.
Please helpHi,
No restrictions on number of columns in 10.2. Do you have any rule transformation or dml handler?
Check also on your bdump if the apply generated any trace file that will allow you to identify the root cause of this error.
Here is an explanation of why that error happens:
The following error occurs when passing an uninitialized object to an Object's member procedure/function:
ORA-30625: method dispatch on NULL SELF argument is disallowed
The following illustrates the error by first creating the Object specification. Notice there is one member procedure "initialize_object" that passes in SELF.
CREATE OR REPLACE TYPE role_type AS OBJECT (
role_name VARCHAR2(30),
MEMBER PROCEDURE initialize_object(SELF IN OUT role_type));
The next step is to create the body of the Object's member procedure. There is no need for any actual code as the error occurs when the NULL is attempted to be passed.
CREATE OR REPLACE TYPE BODY role_type AS
MEMBER PROCEDURE initialize_object (SELF IN OUT role_type) IS
BEGIN
NULL;
END initialize_object;
END;
The following anonymous block passes in a NULL (Uninitialized Object) to the member procedure initialize_object.
DECLARE
V_TEMP role_type;
BEGIN
ROLE_TYPE.initialize_object(V_temp);
END;
ERROR at line 1:
ORA-30625: method dispatch on NULL SELF argument is disallowed
ORA-06512: at line 4
The example has nothing to do with streams but maybe you are trying to invoke an error handler or dml handler that is causing this issue. -
I created a trigger that executes a procedure on INSERT or UPDATE. This is the SQL of the trigger...
DECLARE
INDTS VARCHAR2(15);
REPORTERS VARCHAR2(30);
p_session myschema.wwa_api_module_session;
begin
INDTS:= p_session.get_value_as_varchar2(p_block_name=>'DEFAULT', p_attribute_name => 'A_INDT');
REPORTERS:=p_session.get_value_as_varchar2(p_block_name=>'DEFAULT', p_attribute_name => 'A_REPORTER');
nyspcr.alert_returned_transcripts(INDTS,REPORTERS);
end; .
Basically, the procedure takes in two values that were just inserted into the table to use in the WHERE statement of a query of another table..if there is a match a print statement appears.
This trigger worked(executed the procedure,statement appeared) on the first couple of tries BUT I also got this error message
ORA-30625: method dispatch on NULL SELF argument is disallowed (WWV-16016)
...THEN it stopped working and I still got this error message. What does it mean?I created a trigger that executes a procedure on INSERT or UPDATE. This is the SQL of the trigger...
DECLARE
INDTS VARCHAR2(15);
REPORTERS VARCHAR2(30);
p_session myschema.wwa_api_module_session;
begin
INDTS:= p_session.get_value_as_varchar2(p_block_name=>'DEFAULT', p_attribute_name => 'A_INDT');
REPORTERS:=p_session.get_value_as_varchar2(p_block_name=>'DEFAULT', p_attribute_name => 'A_REPORTER');
nyspcr.alert_returned_transcripts(INDTS,REPORTERS);
end; .
Basically, the procedure takes in two values that were just inserted into the table to use in the WHERE statement of a query of another table..if there is a match a print statement appears.
This trigger worked(executed the procedure,statement appeared) on the first couple of tries BUT I also got this error message
ORA-30625: method dispatch on NULL SELF argument is disallowed (WWV-16016)
...THEN it stopped working and I still got this error message. What does it mean? -
Hi everybody
I'd like to understand the ORA-30625 error that Oracle send while updating a table :
update mytable set id = id ;
returns : ORA-30625...
What's my mistake ?
Thanx.
Here is what I've created :
TYPE : USRDTE
create or replace type UsrDte as object
-- Attributes
usr varchar2(30),
dte date ,
-- Member functions and procedures
member procedure ValDef
create or replace type body UsrDte is
-- Member procedures and functions
member procedure ValDef is
begin
usr := user ;
dte := sysdate ;
end ValDef ;
end ;
create or replace type T_COLSYS as object
-- Attributes
Creation UsrDte
, Modific UsrDte
-- Member functions and procedures
, member procedure OnInsert
, member procedure OnUpdate
create or replace type body T_COLSYS is
-- Member procedures and functions
member procedure OnInsert is
begin
Creation.valDef ;
end OnInsert ;
member procedure OnUpdate is
begin
Modific.ValDef ;
end OnUpdate ;
end;
TABLE :
MyTable with column COLSYS of type T_COLSYS
TRIGGER :
-- Trigger Before on Mytable
create or replace trigger MyTable_tb
before insert or update or delete
on MyTAble
for each row
declare
-- local variables here
begin
if inserting
then
:new.colsys.onInsert ;
elsif updating
then
:new.colsys.onUpdate ;
elsif deleting
then
null ;
end if;
end MyTable_tb;SQL> CREATE OR REPLACE TYPE UsrDte AS OBJECT
2 (
3 -- Attributes
4 usr VARCHAR2(30),
5 dte DATE,
6 -- Member functions and procedures
7 MEMBER PROCEDURE ValDef
8 ) ;
9 /
Type created.
SQL>
SQL> CREATE OR REPLACE TYPE BODY UsrDte IS
2 -- Member procedures and functions
3 MEMBER PROCEDURE ValDef IS
4 BEGIN
5 usr := USER;
6 dte := SYSDATE;
7 END ValDef;
8 END;
9 /
Type body created.
SQL>
SQL>
SQL> CREATE OR REPLACE TYPE T_COLSYS AS OBJECT
2 (
3 -- Attributes
4 Creation UsrDte,
5 Modific UsrDte
6 -- Member functions and procedures
7 ,
8 MEMBER PROCEDURE OnInsert,
9 MEMBER PROCEDURE OnUpdate
10 ) ;
11 /
Type created.
SQL>
SQL> CREATE OR REPLACE TYPE BODY T_COLSYS IS
2 -- Member procedures and functions
3 MEMBER PROCEDURE OnInsert IS
4 BEGIN
5 Creation.valDef;
6 END OnInsert;
7
8 MEMBER PROCEDURE OnUpdate IS
9 BEGIN
10 Modific.ValDef;
11 END OnUpdate;
12 END;
13 /
Type body created.
SQL>
SQL>
SQL> create table MyTable (id NUMBER, COLSYS T_COLSYS) ;
Table created.
SQL>
SQL> CREATE OR REPLACE TRIGGER MyTable_tb
2 BEFORE INSERT OR UPDATE OR DELETE ON MyTAble
3 FOR EACH ROW
4 DECLARE
5 -- local variables here
6 BEGIN
7 :new.colsys := T_COLSYS(UsrDte(NULL, NULL), UsrDte(NULL, NULL)) ; /* might want to avoid on delete */
8 IF inserting
9 THEN
10 :new.colsys.onInsert;
11 ELSIF updating
12 THEN
13 :new.colsys.onUpdate;
14 ELSIF deleting
15 THEN
16 NULL;
17 END IF;
18
19 END MyTable_tb;
20 /
Trigger created.
SQL>
SQL>
SQL> insert into mytable (id) values (1) ;
1 row created.
SQL>
SQL> select * from mytable ;
ID
COLSYS(CREATION(USR, DTE), MODIFIC(USR, DTE))
1
T_COLSYS(USRDTE('OPS$XXXXX\XXXXX', '18-JUN-2004'), USRDTE(NULL, NULL))
1 row selected.
SQL> -
Stacked with Error:-30625:ORA-30625: method dispatch on NULL SELF argument
Hello guys!
I'm totally stacked with Error:-30625 trying to execute CLN_CH_EVENT_SUBSCRIPTION_PKG.CREATE_EVENT_SUB procedure.
i'm initializing that type object like:
WF_EVENT_T.initialize(l_myevent_t);
and then fill it with values...and then passing to that damned procedure. And then em getting error :(.
Could you please somebody explain me what i'm doing wrong or what should i do to avoid this error?!?
thanks in advance.To allow anyone the chance to answer your question, you will need to post the relevant code that leads up to the error code you reference. Without that information, silence is all you can hope to receive.
-
ORA-30625: method dispatch on NULL SELF argument on apply_dml_hanlder
My apply dml handler fails with this message. This dml handler is being called on 10 tables. Is there any way to get the LCR info from the SCN number to track on which table it failed and debug the issue?
Thank Youyour LCR is most probably in the spill over queue rather tha in the queue table. You have to open the AQ$_<cap table>P table. it contains columns of type anydata that embedded the LCR. It is not an easy task but it has been scripted.
download smenu from www.smenu.org, install and type
'aq -lq' to see all your queue tables
'aq -readp <queue table>' to list contents of the queue table and the MSGID and SCN.
pick one MSG that you want to see :
'aq -readp <queue table> -key <MSGID> and you will see the before and after values of the rows contained in the MSG (LCR).
if you want to see the SQL text for this SCN you and the archive is still present on your disk your can pick the SCN of the MSG ID, goes on the source DB (install also smenu) and type lgm -s <SCN> and you will see the text of the SQL at the orgin of this LCR (using logminer).
I am not sure of the compatibility of Smenu for 9i. It has been started in 9I but streams on 9i is so painful that the compatibilty with this mess has not been cared about. -
Problems with XMLType and namespace
Dear subscribers:
I have been using XMLType successfully with simple XMLs - without namespaces. Now I must handle messages with "xmlns" and it seems XMLType is failing.
I tested the following XML, extracted from w3c.org examples:
<?xml version="1.0"?>
<bk:book xmlns:bk=''urn:loc.gov:books''
xmlns:isbn=''urn:ISBN:0-395-36341-6''>
<bk:title>Cheaper by the Dozen</bk:title>
<isbn:number>1568491379</isbn:number>
</bk:book>
The result of xmlt.getRootElement() is book.
However, the use of xmlt.extract( 'book' ) returns an empty object:
xmlt1 := xmlt.extract( 'book' );
dbms_output.put_line( 'StringVal: ' || xmlt1.getStringVal() );
ORA-30625: method dispatch on NULL SELF argument is disallowed
The following usages also raise errors:
xmlt1 := xmlt.extract( 'bk:book' );
ORA-31011: XML parsing failed ORA-19202: Error occurred in XML processing LPX-00601: Invalid token in: 'bk:book' ORA-06512: at "SYS.XMLTYPE", line 111
xmlt1 := xmlt.extract( 'bk::book' );
ORA-31011: XML parsing failed ORA-19202: Error occurred in XML processing LPX-00601: Invalid token in: 'bk::book' ORA-06512: at "SYS.XMLTYPE", line 111
xmlt1 := xmlt.extract( 'book', 'bk' );
ORA-31013: Invalid XPATH expression ORA-06512: at "SYS.XMLTYPE", line 119
I am using Oracle version 10.2.0.1.0. Had someone also faced this problem?
The code I used to test is at the end of this message.
Thanks in advance
====================================
DECLARE
xml varchar2(32000);
xmlt XMLType;
xmlt1 XMLType;
root varchar2(3000);
BEGIN
--Example from w3c.org
xml := '<?xml version="1.0"?>
<bk:book xmlns:bk=''urn:loc.gov:books''
xmlns:isbn=''urn:ISBN:0-395-36341-6''>
<bk:title>Cheaper by the Dozen</bk:title>
<isbn:number>1568491379</isbn:number>
</bk:book>';
xmlt := XMLType( xml );
root := xmlt.getRootElement();
dbms_output.put_line( 'StringVal: ' || xmlt.getStringVal() ); -- The XML is ok
dbms_output.put_line( 'Namespace: ' || xmlt.getNameSpace() ); -- Returns NULL
dbms_output.put_line( 'Root element: ' || root ); -- Returns book
dbms_output.put_line( 'Exists: ' || xmlt.existsNode('book') ); -- Returns ZERO
xmlt1 := xmlt.extract( 'bk:book' ); Raises error (see above)
xmlt1 := xmlt.extract( 'bk::book' ); Raises error (see above)
xmlt1 := xmlt.extract( 'book', 'bk' ); Raises error (see above)
--xmlt1 := xmlt.extract( 'book' );
dbms_output.put_line( 'StringVal: ' || xmlt1.getStringVal() ); Raises error
END;
/If you put your XML into a namespace then you also need to extract from that namespace.... e.g.
No namespace...
SQL> select t.xml.extract('myroot')
2 from (select XMLTYPE('<myroot><mychild>test</mychild></myroot>') as xml from dual) t
3 ;
T.XML.EXTRACT('MYROOT')
<myroot>
<mychild>test</mychild>
</myroot>Put XML in namespace and now the extract returns nothing...
SQL> ed
Wrote file afiedt.buf
1 select t.xml.extract('myroot')
2* from (select XMLTYPE('<myroot xmlns="fred"><mychild>test</mychild></myroot>') as xml from dual) t
3 /
T.XML.EXTRACT('MYROOT')
--------------------------------------------------------------------------------------------------------Extract, specifying the namespace to extract from and now returns the result...
SQL> ed
Wrote file afiedt.buf
1 select t.xml.extract('myroot', 'xmlns="fred"')
2* from (select XMLTYPE('<myroot xmlns="fred"><mychild>test</mychild></myroot>') as xml from dual) t
SQL> /
T.XML.EXTRACT('MYROOT','XMLNS="FRED"')
<myroot xmlns="fred">
<mychild>test</mychild>
</myroot>
SQL>;) -
Oracle 10g trigger to pass variable to xmltype.existsnode() function
Hi all,
Could anyone please help me on this? It is kind of urgent.
I created a trigger below, it compiled successfully, but when I tried to insert a xml document into oracle 10g db, I got error message says:
550- Error Response
ORA-00604: error occurred at recursive SQL level 1
ORA-30625: method dispatch on NULL SELF argument is disallowed
ORA-06512: at "CONTENTDB.VALIDATE_LINK", line 11
ORA-04088: error during execution of trigger 'CONTENTDB.VALIDATE_LINK'
550 End Error Response
My trigger is:
CREATE OR REPLACE TRIGGER VALIDATE_LINK
BEFORE insert on TABLE_LINK
FOR each row
DECLARE
v_key VARCHAR2(1000);
v_count NUMBER(5);
xmldata XMLType;
begin
xmldata := :new.sys_nc_rowinfo$;
IF xmldata.existsnode('/link/key') = 1 THEN
v_key := xmldata.extract('/link/@key').getStringVal();
select count(*) into v_count from table_link WHERE (existsNode(object_value,'/link[key=v_key]') = 1 )
and (existsNode(object_value,'/link/publishingElements[TestingFlag="true"]') = 1);
if (v_count >= 1) then
raise_application_error (-20001, 'TestingFlag can only have one true value.');
end if;
end if;
end;
I have questions regarding above trigger:
1) it seems extract() doesn't work in statement below: v_key := xmldata.extract('/link/@key').getStringVal();
2) can I pass a variable v_key into xmltype.existsnode() function? if yes, what is the right format to do so?
Thanks a lot.
HonsonHi Mark,
Thanks for your comments, I have added checking for xmltype object is not null logic. and my initial problem was fixed, the only last problem I am having now is xmltype.extract().
CREATE OR REPLACE TRIGGER VALIDATE_LINK
BEFORE insert on table_LINK
FOR each row
DECLARE
v_key VARCHAR2(4000);
v_count NUMBER(5);
xmldata XMLType;
v_tmp VARCHAR2(4000);
begin
xmldata := :new.sys_nc_rowinfo$;
if (xmldata is not null) then
IF xmldata.existsnode('/link/key') = 1 THEN
v_key := xmldata.extract('/link/key').getStringVal();
v_tmp := '/link[key=' || v_key || ']';
select count(*) into v_count from cibc_link WHERE (existsNode(object_value,v_tmp) = 1 )
and (existsNode(object_value,'/link/publishingElements[TestingFlag="true"]') = 1);
if (v_count >= 1) then
raise_application_error (-20001, 'TestingFlag can only have one true value.');
end if;
end if;
end if;
end;
I am expecting this statement:
v_key := xmldata.extract('/link/key').getStringVal();
return v_key := content.link.viewPrintableVISACreditCard
but now it always returns like this:
v_key := <key>content.link.viewPrintableVISACreditCard</key>
I don't want the xml tag <key></key> returned by extract().getStringVal() function.
Could you or anyone please help?
Thanks.
Honson
Maybe you are looking for
-
I need/want answers to how to STOP being treated (for the most part, there ARE exceptions). If needed how to end my contract without going through the ringer and see what other "actions" others are doing. Thank you.
-
Report server is not starting up...
Hi, I am using Oracle 9iDS since last 1 year and everything was fine. suddenly I am getting below error during startup of report server Report server startup command ---> rwserver server=rep_in011370 batch=no Error : REP-50142 : Read file c:\Oracle\O
-
My i4s phone does not ring on incoming calls. The settings appear to be correct
My i4s phone does not ring on incoming calls. The settings appear to be correct for the phone to ring. Also, during a call, when I hit the speaker buttom, I can neither hear nor be heard by the other party Any suggestions?
-
Is there a template for address labels?
How di I make address lables in pages?
-
Hello, I have an question about the data store in SharePoint. I want to create a SharePoint Website with a list that contain sensible data. My first idea was to use an External List (SQL Server) of an other Server for don't have the data into the fro