Xdb.jar and ojdbc14.jar incompatibility ( XMLType.createXML() ) ??
I am using the latest xdb.jar (from xdk_java_9_2_0_5_0.zip) and ojdbc14.jar
and it appears that xdb.jar calls a method that does not exist in ojdbc14.jar.
It happens when executing
OPAQUE opaque = rset.getOPAQUE("value");
XMLType xt = XMLType.createXML(opaque); // <-- here
The exact error message is:
java.lang.NoSuchMethodError: oracle.jdbc.internal.OracleConnection.getProtocolType()Ljava/lang/String;
at oracle.xdb.XMLType.initConn(XMLType.java:2072)
at oracle.xdb.XMLType.<init>(XMLType.java:903)
at oracle.xdb.XMLType.createXML(XMLType.java:493)
Hi,
There are known problems with xdb.jat that is bundled with XDK 9205.
As a workaround, you need to use an older version of xdb.jar from either XDK-9.2.0.3 or XDK-9.2.0.4 since the mentioned exception is generally thrown due to problems in xdb.jar that comes with XDK-9205.
If you do not have any of these versions of XDK, you could use the xdb.jar that comes with the database 9.2.0.3. The xdb.jar is present in <oracle_home>/rdbms/jlib folder.
Hope that helps.
Shefali
Similar Messages
-
I am using JDeveloper 10.1.3 and get the following error when executing the web service proxy with my call to the web service( this web service is using class OracleXMLSave with method insertXML):
I have included the xdb.jar in my project properties libraries of the web service project and added a file group with xdb.jar to the properties of the webservices.deploy. What else needs to be done? This worked in JDeveloper 10.1.2.
THE ERROR after running proxy in log window:
java.rmi.ServerException:
start fault message:
caught exception while handling request: caught exception while handling request: oracle.classloader.util.AnnotatedNoClassDefFoundError:
Missing class: oracle.xdb.XMLType
Dependent class: dbdata2package.DBDataOperations
Loader: DBData2WSApp-DBData2Operations-WS.web.WebServices:0.0.0
Code-Source: /D:/h/cots/Oracle/JDeveloper10g10.1.3/j2ee/home/applications/DBData2WSApp-DBData2Operations-WS/WebServices/WEB-INF/classes/
Configuration: WEB-INF/classes/ in D:\h\cots\Oracle\JDeveloper10g10.1.3\j2ee\home\applications\DBData2WSApp-DBData2Operations-WS\WebServices\WEB-INF\classes
The missing class is available from the following locations:
1. Code-Source: /D:/h/cots/Oracle/JDeveloper10g10.1.3/j2ee/home/applications/DBDataWSApp-webservice-WS/WebServices/WEB-INF/lib/xdb.jar (from WEB-INF/lib/ directory in D:\h\cots\Oracle\JDeveloper10g10.1.3\j2ee\home\applications\DBDataWSApp-webservice-WS\WebServices\WEB-INF\lib)
This code-source is available in loader DBDataWSApp-webservice-WS.web.WebServices:0.0.0.
2. Code-Source: /D:/h/cots/Oracle/JDeveloper10g10.1.3/j2ee/home/applications/DBDataWSApp-DBDataOperations-WS/WebServices/WEB-INF/lib/xdb.jar (from WEB-INF/lib/ directory in D:\h\cots\Oracle\JDeveloper10g10.1.3\j2ee\home\applications\DBDataWSApp-DBDataOperations-WS\WebServices\WEB-INF\lib)
This code-source is available in loader DBDataWSApp-DBDataOperations-WS.web.WebServices:0.0.0.
:end fault message
at oracle.j2ee.ws.client.StreamingSender._raiseFault(StreamingSender.java:545)
at oracle.j2ee.ws.client.StreamingSender._sendImpl(StreamingSender.java:390)
at oracle.j2ee.ws.client.StreamingSender._send(StreamingSender.java:111)
at dbdata2packageproxy.runtime.DBData2WSSoapHttp_Stub.insertData(DBData2WSSoapHttp_Stub.java:80)
at dbdata2package.DBData2WSSoapHttpPortClient.insertData(DBData2WSSoapHttpPortClient.java:54)
at dbdata2package.DBData2WSSoapHttpPortClient.main(DBData2WSSoapHttpPortClient.java:34)
Process exited with exit code 0.Hi,
actually you increment the index
pstmt.setString(++idx,inrecord.getCommentID());
which means you never have an index of 0 but always start with 1
Frank -
Xdb.jar and xmlparserv2.jar for JBossWeb/2.0.0.GA
I am using xdb.jar and xmlparserv2.jar files in JBoss 4.0.0 and it is working fine but when i deploy my code on JBossWeb/2.0.0.GA it is giving error.
"java.lang.NullPointerException
org.apache.commons.digester.Digester.getXMLReader(Digester.java:899)
org.apache.commons.digester.Digester.parse(Digester.java:1647)
org.apache.struts.action.ActionServlet.parseModuleConfigFile(ActionServlet.java:1006)
org.apache.struts.action.ActionServlet.initModuleConfig(ActionServlet.java:955)
org.apache.struts.action.ActionServlet.init(ActionServlet.java:470)
javax.servlet.GenericServlet.init(GenericServlet.java:212)
org.jboss.web.tomcat.security.SecurityAssociationValve.invoke(SecurityAssociationValve.java:179)
org.jboss.web.tomcat.security.JaccContextValve.invoke(JaccContextValve.java:84)
org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:104)
org.jboss.web.tomcat.service.jca.CachedConnectionValve.invoke(CachedConnectionValve.java:157)
org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:241)
org.apache.coyote.ajp.AjpProcessor.process(AjpProcessor.java:437)
org.apache.coyote.ajp.AjpProtocol$AjpConnectionHandler.process(AjpProtocol.java:381)
org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:447)
java.lang.Thread.run(Thread.java:595)"
Could anyone pleaese suggest what could be the possibe reason for this error. Do we need some differant version of jar files for the JBossWeb/2.0.0.GA.
Thanks and Regards
Govind BajoriaI had a similar problem using xmlparserv2.jar and commons-digester in the same application. It appears that xmlparserv2 sets itself as the default SaxParser but commons-digester doesn't like this (I read it looks for a Version class for the SaxParser and can't find it).
I solved this problem by explictly setting the SaxParserFactory by adding this System parameter
-Djavax.xml.parsers.SAXParserFactory=com.sun.org.apache.xerces.internal.jaxp.SAXParserFactoryImpl
This works for JDK 6 but I assume if you are using an early JDK version and have xerces jar on the class path then setting the following will also work
-Djavax.xml.parsers.SAXParserFactory=org.apache.xerces.jaxp.SAXParserFactoryImpl -
Validating XML with XMLType.CreateXML and a schema
I created a schema with:
dbms_xmlschema.registerSchema('com/company/user/project/forexample.xsd', xsd_as_clob);
This works fine and I can see the elements of my schema in the enterprise manager.
However when I try to use this schema with:
xmltype_variable := XMLType.CreateXML(xml_as_clob, 'com/company/user/project/forexample.xsd', 0, 0);
I get the following message:
ORA-31000: Resource 'com/company/user/project/forexample.xsd' is not an XDB schema document.
What am I doing wrong?
I have 9.2.0.1.0 running on Windows 2000.your path looks wrong to me 'com/company/...' should really be something like '/com/company/...' since I take it that your com folder is really under the Resources top level folder. /com is an absolute path com is a relative path and it is difficult to know your current context so a relative path could be pointing to anything!
-
Xmltype.createxml not working after upgrading to 11202 from 10203
Hi,
i was referred here from Java Database Connectivity (JDBC) forum. the link to the original post:
using XML with websphere jdbc adapter 2.6 on 11.2.0.2
again, the adapter is using the function xmltype.createxml (and there it uses xmltype_lib) and it fails right at the beginning because it cannot parse the xml properly.
so what im asking is, was there any major changes from 10.2 to 11.2 to the way xml creation works? maybe a different encoding? how can i check the encoding of the xml created? is there a property for it?
thanks in advance.
Edited by: andrey on Mar 12, 2012 4:47 AMyes the client and the server are same version.
the error stack from the adapter:
[Time: 2012/03/13 13:00:00.177] [system: ConnectorAgent] [SS: jdbc_orclConnector] [Thread: JDBC_ORCL.REQUECTQUEUEJmsThreadPool.thread18(#746207754)] [Type:error] [MsgID: 10556] [Mesg: Exception Detail: com.crossworlds.cwconnectorapi.exceptions.VerbProcessingFailedException
[Type: Error] [MsgID:37010] [Mesg: Stored Procedure Execution Failed: java.SQLException: [IBM-CrossWorlds][Oracle JDBC Driver][Oracle]
ora-30676: socket read or write failed
ora-06512: at "SYS.XMLTYPE", line 5
ora-06512: at "SCHEMA_NAME.FUNC_NAME", line 1695
ora-06512: at "SCHEMA_NAME.FUNC_NAME", line 78
ora-06512: at line 1 -
Sys.XMLType.createxml unable to insert in 9i through sqlplus
I am trying to insert xmltype (sys.XMLType.createxml()) data through sqlplus in oracle.
i am getting error as literal string too long.
setting long as 1000000
i am able to read and display the contents.
But still NOT able to INSERT. The data is around 47784 charaters.
any clues or any useful links.
the query that i am using
insert into sometable values("",sys.XMLType.createxml('string of around 48000 chars'));
error that i recieve
ORA-01704: string literal too longI am trying to insert xmltype (sys.XMLType.createxml()) data through sqlplus in oracle.
i am getting error as literal string too long.
setting long as 1000000
i am able to read and display the contents.
But still NOT able to INSERT. The data is around 47784 charaters.
any clues or any useful links.
the query that i am using
insert into sometable values("",sys.XMLType.createxml('string of around 48000 chars'));
error that i recieve
ORA-01704: string literal too long -
Sys.XMLType.createxml unable to insert through sqlplus
I am trying to insert xmltype (sys.XMLType.createxml()) data through sqlplus in oracle.
i am getting error as literal string too long.
setting long as 1000000
i am able to read and display the contents.
But still NOT able to INSERT. The data is around 47784 charaters.
any clues or any useful links.
the query that i am using
insert into sometable values("",sys.XMLType.createxml('string of around 48000 chars'));
error that i recieve
ORA-01704: string literal too longActually the limit is approx 32K bytes for a SQL*PLUS literal...
If your XML is schema based 9iR2 allows you to upload the XML direct to the database and store in tables you define using FTP or WebDAV.
If the content is not schema based and you can ftp the file to the local file system of the machine running the server you can do something like this using the bfile mechanism.
Note this is a 9iR2 example, that takes care of converting the character set of the file into the character set of the database...
set echo on
create or replace function getContent(file bfile,
charset varchar2 default 'WE8MSWIN1252'
return CLOB deterministic
is
charContent CLOB;
targetFile bfile;
dest_offset number := 1;
src_offset number := 1;
lang_context number := 0;
conv_warning number := 0;
begin
targetFile := file;
DBMS_LOB.createTemporary(charContent,true,DBMS_LOB.SESSION);
DBMS_LOB.fileopen(targetFile, DBMS_LOB.file_readonly);
DBMS_LOB.loadClobfromFile
charContent,
targetFile,
DBMS_LOB.getLength(targetFile),
dest_offset,
src_offset,
nls_charset_id(charset),
lang_context,
conv_warning
DBMS_LOB.fileclose(targetFile);
return charContent;
end;
show errors
create or replace function getFileContent(file bfile,
charset varchar2 default 'WE8MSWIN1252'
return CLOB deterministic
is
begin
return getContent(file,charset);
end;
show errors
create or replace function getDocument(filename varchar2,
charset varchar2 default 'WE8MSWIN1252'
return CLOB deterministic
is
file bfile := bfilename('DIR',filename);
begin
return getFileContent(file,charset);
end;
show errors
create or replace function getXML(filename varchar2,
charset varchar2 default 'WE8MSWIN1252'
return XMLTYPE deterministic
is
DOC clob;
XML xmltype;
begin
DOC := getDocument(filename,charset);
XML := xmltype(DOC);
dbms_lob.freeTemporary(DOC);
return XML;
end;
show errors
drop directory DIR
create directory DIR as '/tmp/xmlDir'
commit
insert into some table values ("",getXML('Filename.xml'));The above example assumes that the file in the directory '/tmp/xmlDir'; -
Forms 10g crashes on XMLType.createXML()
Hello,
I'm using Forms 10g services for calling a web service, I'm using standard soap request / respond function :
function myfun() returns varchar2 is
soap_request varchar2(30000);
soap_respond varchar2(30000);
http_req utl_http.req;
http_resp utl_http.resp;
resp XMLType;
begin
soap_request:='<?xml version="1.0" encoding="UTF-8"?><SOAP-ENV:Envelope
xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"
xmlns:xsi="http://www.w3.org/1999/XMLSchema-instance"
xmlns:xsd="http://www.w3.org/1999/XMLSchema">
http_req:= utl_http.begin_request (url, 'POST', 'HTTP/1.1');
utl_http.set_header(http_req, 'Content-Type', 'text/xml');
utl_http.set_header(http_req, 'Content-Length', length(soap_request));
utl_http.set_header(http_req, 'SOAPAction','');
utl_http.write_text(http_req, soap_request);
http_resp:= utl_http.get_response(http_req);
utl_http.read_text(http_resp, soap_respond);
utl_http.end_response(http_resp);
resp:= XMLType.createXML(soap_respond);
resp:= resp.extract('/soap:Envelope/soap:Body/child::node()', 'xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/"');
resp:=resp.extract('ns1:MyResponse/MyReturn/text()','xmlns:ns1="urn:wslice_vstv"');
return resp.getClobVal();
end;soap_respond looks like this:
<?xml version="1.0" encoding="UTF-8"?>
<SOAP-ENV:Envelope SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="urn:wslice_vstv" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/">
<SOAP-ENV:Body>
<ns1:MyResponse>
<MyReturn xsi:type="xsd:string">testno# testname# testname2# testname3# testname4# </MyReturn>
</ns1:MyResponse>
</SOAP-ENV:Body>
</SOAP-ENV:Envelope>Forms crashes on resp:= XMLType.createXML(soap_respond) with error:
FRM-92101: There was a failure in the Forms Server during startup. This could happen due to invalid configuration.
Please look into the web-server log file for details.
Details...
Java Exception:
oracle.forms.net.ConnectionException: Forms session <92> abourted: unable to communicate with runtime process.
at oracle.forms.net.ConnectionException.createConnectionException(Unknown Source)
at oracle.forms.net.HTTPNStream.getResponse(Unknown Source)
at oracle.forms.net.HTTPNStream.doFlush(Unknown Source)
at oracle.forms.net.HTTPNStream.flush(Unknown Source)
at java.io.DataOutputStream.flush(Unknown Source)
at oracle.forms.net.StreamMessageWriter.run(Unknown Source)
Does anyone have any idea why this happens? There is no xmlparse error or something similar, just what I wrote above.
Thanks,
JelenaHello,
1.) You missed out important informations like database and forms versions
2.) where did you write this? dbms_output.put_line will not display anything in forms (unless you get the lines you put on the buffer back with get_lines which is kind of useless in your case)
3.) You might want to read all responses; here:
Jelena Stankov wrote:
"Forms is an old product and does not support all the new PL/SQL database types. If you can't see the datatype in the list displayed for 'Data Type' for a form's item then you most probably won't be able to use it in a form." (http://www.orafaq.com/forum/t/128146/2/)
is the solution to your problem.
4.) this
cursor cursor_xml (p_id in varchar2)
is select * from MY_TABLE where id=p_id for update;
rec cursor_xml%rowtype;is a bad idea. using %rowtype and select * is a real bad coding practice and will lead to unexpected behaviour when you do changes to the underlying table. In fact why do you want to do this anyway? You take some informations out of your table, create an xmltype of it and put it back into the table? What happens when you do changes to your data? You will have to do this again (probably in a database trigger <sigh>)...
Why not simply:
SQL> select level, xmltype('<company>'||level||'</company>') from dual connect by level < 20;
LEVEL|XMLTYPE('<COMPANY>'||LEVEL||'</COMPANY>')
----------|---------------------------------------------------------------------------------------------------------------
1|<company>1</company>
2|<company>2</company>
3|<company>3</company>
4|<company>4</company>
5|<company>5</company>
6|<company>6</company>
7|<company>7</company>
8|<company>8</company>
9|<company>9</company>
10|<company>10</company>
11|<company>11</company>
12|<company>12</company>
13|<company>13</company>
14|<company>14</company>
15|<company>15</company>
16|<company>16</company>
17|<company>17</company>
18|<company>18</company>
19|<company>19</company>
19 rows selected.create a view upon that end never bother again with updating your xmltype column?
cheers -
Sys.Xmltype.Createxml performance
Hello all,
I have these two functions,these functions are present in a package and this package is being called from .net code.There is a lot of performance issue with this code,It is taking 27 minutes for inserting 1000 rows,please help me fine tune this piece of code.And also there is a before insert trigger for the table XXXXXX
since we are using the concept of VPD here
There are close to 14000 rows to be inserted,please help.
Database version
Oracle Database 10g Enterprise Edition Release 10.2.0.5.0 - 64bi
PL/SQL Release 10.2.0.5.0 - Production
CORE 10.2.0.5.0 Production
TNS for Solaris: Version 10.2.0.5.0 - Production
NLSRTL Version 10.2.0.5.0 - Production
Procedure Some_Information(in_Some_Details In Clob, in_Batch_Id In Varchar2, in_Modified_User_Uid In Varchar2, in_Modified_Date In Varchar2, out_Status Out Varchar2, out_Error Out Varchar2)
As
Begin
Xml_Type:=Sys.Xmltype.Createxml(in_Some_Details);
Insert Into XXXXXX(I_Batch_Id,I_Client_Account_Id,V_Client_Legal_Name,
V_Old_Office_Code, V_Old_Office_Business_Name,V_New_Office_Code,V_New_Office_Business_Name,
V_Old_Cost_Center_Code,V_Old_Cost_Center_Name,V_New_Cost_Center_Code, V_New_Cost_Center_Name,
V_Client_Status,D_Client_Inactivation_Date,V_Select_Ynflag,
V_Replace_Ynflag,V_Replace_All_Policy_Ynflag,V_Replace_All_Service_Ynflag,
I_Created_By_Uid,I_Modified_By_Uid,
D_Created_Timestamp,D_Modified_Timestamp,
V_Batch_Status,D_Pol_Eff_Date_From,D_Pol_Eff_Date_To
(Select in_Batch_Id, A.CLIENT_ACCOUNT_ID, A.CLIENT_LEGAL_NAME, A.OLD_OFFICE_CODE, A.OLD_OFFICE_BUSINESS_NAME,
A.NEW_OFFICE_CODE, A.NEW_OFFICE_BUSINESS_NAME, A.OLD_COST_CENTER_CODE, A.OLD_COST_CENTER_NAME,
A.NEW_COST_CENTER_CODE, A.NEW_COST_CENTER_NAME, A.CLIENT_STATUS,
CASE
WHEN A.CLIENT_INACTIVATION_DATE =' ' THEN NULL
ELSE To_Date(A.CLIENT_INACTIVATION_DATE,'DD/MM/YYYY')
END ,
A.SELECT_FLAG, A.REPLACE_FLAG, A.REPLACE_ALL_POLICY_FLAG, A.REPLACE_ALL_SERVICE_FLAG,
in_Modified_User_Uid,in_Modified_User_Uid,
To_Date(in_Modified_Date,'yyyyMMddhh24miss'),To_Date(in_Modified_Date,'yyyyMMddhh24miss'),'A',
CASE
WHEN A.POL_EFF_DATE_FROM =' ' THEN NULL
ELSE To_Date(A.POL_EFF_DATE_FROM,'DD/MM/YYYY')
END ,
CASE
WHEN A.POL_EFF_DATE_TO =' ' THEN NULL
ELSE To_Date(A.POL_EFF_DATE_TO,'DD/MM/YYYY')
END
From (
SELECT
(CLIDETAIL.EXTRACT('//InformationSet/I_CLIENT_ACCOUNT_ID/text()').getstringval()) as CLIENT_ACCOUNT_ID,
Escape_Chars(CLIDETAIL.EXTRACT('//InformationSet/V_CLIENT_LEGAL_NAME/text()').getstringval()) as CLIENT_LEGAL_NAME,
(CLIDETAIL.EXTRACT('//InformationSet/V_OLD_OFFICE_CODE/text()').getstringval()) as OLD_OFFICE_CODE,
Escape_Chars(CLIDETAIL.EXTRACT('//InformationSet/V_OLD_OFFICE_NAME/text()').getstringval()) as OLD_OFFICE_BUSINESS_NAME,
(CLIDETAIL.EXTRACT('//InformationSet/V_NEW_OFFICE_CODE/text()').getstringval()) as NEW_OFFICE_CODE,
Escape_Chars(CLIDETAIL.EXTRACT('//InformationSet/V_NEW_OFFICE_NAME/text()').getstringval()) as NEW_OFFICE_BUSINESS_NAME,
(CLIDETAIL.EXTRACT('//InformationSet/V_OLD_COSTCENTER_CODE/text()').getstringval()) as OLD_COST_CENTER_CODE,
Escape_Chars(CLIDETAIL.EXTRACT('//InformationSet/V_OLD_COSTCENTER_NAME/text()').getstringval()) as OLD_COST_CENTER_NAME,
(CLIDETAIL.EXTRACT('//InformationSet/V_NEW_COSTCENTER_CODE/text()').getstringval()) as NEW_COST_CENTER_CODE,
Escape_Chars(CLIDETAIL.EXTRACT('//InformationSet/V_NEW_COSTCENTER_NAME/text()').getstringval()) as NEW_COST_CENTER_NAME,
Escape_Chars(CLIDETAIL.EXTRACT('//InformationSet/V_CLIENT_STATUS/text()').getstringval()) as CLIENT_STATUS,
(CLIDETAIL.EXTRACT('//InformationSet/V_CLIENT_INACTIVATION_DATE/text()').getstringval()) as CLIENT_INACTIVATION_DATE,
Escape_Chars(CLIDETAIL.EXTRACT('//InformationSet/V_SELECT_FLAG/text()').getstringval()) as SELECT_FLAG,
Escape_Chars(CLIDETAIL.EXTRACT('//InformationSet/V_REPLACE_FLAG/text()').getstringval()) as REPLACE_FLAG,
Escape_Chars(CLIDETAIL.EXTRACT('//InformationSet/V_REPLACE_ALL_POLICY_FLAG/text()').getstringval()) as REPLACE_ALL_POLICY_FLAG,
Escape_Chars(CLIDETAIL.EXTRACT('//InformationSet/V_REPLACE_ALL_SERVICE_FLAG/text()').getstringval()) as REPLACE_ALL_SERVICE_FLAG,
(CLIDETAIL.EXTRACT('//InformationSet/V_POL_EFF_DATE_FROM/text()').getstringval()) as POL_EFF_DATE_FROM,
(CLIDETAIL.EXTRACT('//InformationSet/V_POL_EFF_DATE_TO/text()').getstringval()) as POL_EFF_DATE_TO
FROM TABLE(XMLSEQUENCE(Xml_Type.EXTRACT('//NewDataSet/InformationSet')))CLIDETAIL
) A
Where Not Exists (Select 1 From XXXXX1 M Where M.I_Batch_Id=in_Batch_Id And M.I_Client_Account_Id=A.Client_Account_Id)
out_Status:='0';
out_Error:='No Error 2';
dbms_output.put_line(out_Status);
EXCEPTION WHEN OTHERS THEN
out_Status:='100';
out_Error:= SQLERRM;
End;
Function Escape_Chars(in_Details Varchar2) Return Varchar2 Is
Begin
If Replace(Replace(Replace(Replace(Replace(Trim(in_Details),
''||'&'||' amp;',''||'&'||''),
''||'&'||' quot;','"'),
''||'&'||' lt;','<'),
''||'&'||' gt;','>'),
''||'&'||' apos;',''''
) = '' Then
Return Null;
Else
Return Replace(Replace(Replace(Replace(Replace(Trim(in_Details),
''||'&'||'amp;',''||'&'||''),
''||'&'||'quot;','"'),
''||'&'||'lt;','<'),
''||'&'||'gt;','>'),
''||'&'||'apos;',''''
End If;
End;Hello Marco,
I am a novice in Oracle with xml,please help me out with the following question listed in the points below
1) re-write the whole
From (
SELECT (CLIDETAIL.EXTRACT('//InformationSet/I_CLIENT_ACCOUNT_ID/text()').getstringval()) as CLIENT_ACCOUNT_ID,
Escape
bit to 1 XMLTABLE statement, if not only you will be easily see issues and/or get rid of all the clutter via "extract"
Point 1 I am exploring it,since I do not know anything about XMLTABLE.
2) Use the full XPath path in this statement - do not use // everywhere in the statement (this alone will be drastically improve your performance).
I have made the change mentioned in point 2 except for this section in the previous post,please let me know if i have to make the change here also,
FROM TABLE(XMLSEQUENCE(Xml_Type.EXTRACT('//NewDataSet/InformationSet')))
My Xml will be of the format
<NewDataSet>
<InformationSet>
<I_CLIENT_ACCOUNT_ID>Some value</I_CLIENT_ACCOUNT_ID>
</NewDataSet>
</InformationSet>
3) Do not use the OO notation. eg. "user.table.xmltype.extract.operator" but the supported notation, eg. "extract(user.table.xmltype, '$XPath', '$namspce').operator"
Point 3 I have made the changes
4) Do not use XML/SQL operators anymore, they will be deprecated/desupported in future versions (11, 12, xx). Use the offcial W3 XML standards, in the case XQuery alternatives like XMLTABLE. If not only they do already support XPath V2 while the XML/SQL stuff only supports XPath V1.
Point 4 can you please elaborate on XML/SQL operators that I am using in my code,so sorry this is dumb but still.
5) escape handling can also be done by a by Oracle supported function in package DBMS_XMLGEN (convert? and other procedures/functions), why write your own (would something like a regular expression comparison etc not be easier instead of replace(replace(replace...)
Thank you very much,I have handled the point 5 by using the DBMS_XMLGEN.convert -
XMLTYPE.createxml - how to free memory?
I use XMLTYPE.createxml to generate XML and my PGA memory use skyrockets. How can I free it?
SQL> select * from v$version;
BANNER
Oracle Database 11g Enterprise Edition Release 11.2.0.1.0 - 64bit Production
PL/SQL Release 11.2.0.1.0 - Production
CORE 11.2.0.1.0 Production
TNS for Linux: Version 11.2.0.1.0 - Production
NLSRTL Version 11.2.0.1.0 - Production
SQL> select n.NAME, t.VALUE
2 from v$mystat t, v$statname n
3 where t.STATISTIC# = n.STATISTIC#
4 and n.NAME like 'session%memory%'
5 order by name;
NAME VALUE
session pga memory 2236760
session pga memory max 2236760
session uga memory 1729280
session uga memory max 1729280
SQL> declare
2 v_ref_cur sys_refcursor;
3 v_xmltypebuf XMLTYPE;
4 begin
5 for i in 1..10000 loop
6 open v_ref_cur for select * from dual ;
7 v_xmltypebuf := XMLTYPE.createxml(v_ref_cur);
8 close v_ref_cur;
9 end loop;
10 end;
11 /
PL/SQL procedure successfully completed.
SQL> select n.NAME, t.VALUE
2 from v$mystat t, v$statname n
3 where t.STATISTIC# = n.STATISTIC#
4 and n.NAME like 'session%memory%'
5 order by name;
NAME VALUE
session pga memory 101458264
session pga memory max 101458264
session uga memory 99764800
session uga memory max 99764800Thank you in advance,
TonyGiven you are on 11.2, I would open a bug with Oracle regarding this issue. It should not be leaking memory like this and you have a nice simple test case to work from. I tried some other variants including using DBMS_SESSION.FREE_UNUSED_USER_MEMORY; and none of them leaked memory in the first place. Here, for all to see, is your example using DBMS_SESSION.FREE_UNUSED_USER_MEMORY; and showing no change in memory used.
Connected to Oracle Database 11g Enterprise Edition Release 11.1.0.6.0
SQL>
SQL> select n.NAME, t.VALUE
2 from v$mystat t, v$statname n
3 where t.STATISTIC# = n.STATISTIC#
4 and n.NAME like 'session%memory%'
5 order by name;
NAME VALUE
session pga memory 1767576
session pga memory max 1767576
session uga memory 1362360
session uga memory max 1362360
SQL> declare
2 v_ref_cur sys_refcursor;
3 v_xmltypebuf XMLTYPE;
4 begin
5 for i in 1..10000 loop
6 open v_ref_cur for select * from dual ;
7 v_xmltypebuf := XMLTYPE.createxml(v_ref_cur);
8 close v_ref_cur;
9 end loop;
10 end;
11 /
PL/SQL procedure successfully completed
SQL> select n.NAME, t.VALUE
2 from v$mystat t, v$statname n
3 where t.STATISTIC# = n.STATISTIC#
4 and n.NAME like 'session%memory%'
5 order by name;
NAME VALUE
session pga memory 122550424
session pga memory max 122550424
session uga memory 121357872
session uga memory max 121357872
SQL>
SQL> select n.NAME, t.VALUE
2 from v$mystat t, v$statname n
3 where t.STATISTIC# = n.STATISTIC#
4 and n.NAME like 'session%memory%'
5 order by name;
NAME VALUE
session pga memory 122550424
session pga memory max 122681496
session uga memory 121357872
session uga memory max 121481324
SQL> -- Several minutes later
SQL> /
NAME VALUE
session pga memory 121895064
session pga memory max 122681496
session uga memory 121292408
session uga memory max 121481324
SQL> begin
2 DBMS_SESSION.FREE_UNUSED_USER_MEMORY;
3 end;
4 /
PL/SQL procedure successfully completed
SQL>
SQL> select n.NAME, t.VALUE
2 from v$mystat t, v$statname n
3 where t.STATISTIC# = n.STATISTIC#
4 and n.NAME like 'session%memory%'
5 order by name;
NAME VALUE
session pga memory 121698456
session pga memory max 122681496
session uga memory 121096016
session uga memory max 121481324So I went on to testing alternatives using your structure to verify where the leak was and what could be causing it.
1) Using just
v_xmltypebuf := XMLTYPE(v_ref_cur);
produced the same results as above
2) Commenting out that line produces memory results in line with my first sample in the previous post, where memory is freed up shortly after execution is done.
3) Using again
v_xmltypebuf := XMLTYPE('<root/>');
does not produce a memory leak,
4) Sending in a CLOB CLOB set outside the loop to '<root/>' does not produce a memory leak.
5) Using ANYDATA uses a lot of memory but that gets freed up automatically
Connected to Oracle Database 11g Enterprise Edition Release 11.1.0.6.0
SQL>
SQL> select n.NAME, t.VALUE
2 from v$mystat t, v$statname n
3 where t.STATISTIC# = n.STATISTIC#
4 and n.NAME like 'session%memory%'
5 order by name;
NAME VALUE
session pga memory 1767576
session pga memory max 1767576
session uga memory 1362360
session uga memory max 1362360
SQL> declare
2 v_ref_cur sys_refcursor;
3 v_xmltypebuf XMLTYPE;
4 begin
5 for i in 1..10000 loop
6 open v_ref_cur for select * from dual ;
7 v_xmltypebuf := XMLTYPE(anydata.convertVarchar2('root'));
8 close v_ref_cur;
9 end loop;
10 end;
11 /
PL/SQL procedure successfully completed
SQL> select n.NAME, t.VALUE
2 from v$mystat t, v$statname n
3 where t.STATISTIC# = n.STATISTIC#
4 and n.NAME like 'session%memory%'
5 order by name;
NAME VALUE
session pga memory 90831000
session pga memory max 90831000
session uga memory 89477120
session uga memory max 89477120
SQL> / -- one minute later
NAME VALUE
session pga memory 2095256
session pga memory max 90962072
session uga memory 1624216
session uga memory max 89600572I don't have everything setup to test a BFILENAME alternative yet but I'll try to get that setup done and update once done.
Marco, see anything I missed? -
ILM assistant XDB username and password not working
Hi All,
Hi I'm using ILM 1.3 with Oracle 11g on HP.
I am able to log-in to apex server but not ILM assistant.
http://dblxamd02.vxindia.veritas.com:8080/apex/apex_admin it works with admin/oracle.
But im not able to login to http://dblxamd02.vxindia.veritas.com:8080 when it asks for XDB username and password.
I tried to reset the password using apxxepwd.sql but not luck.
Did anybody observer this issue ? if so can somebody please reply me ASAP ?
Thanks in advance.There are two wats to install the ILM toolkit:
1) Directly on the server where your instance is located. In this case you do not need to provide a TNS connection name. Therefore, you would execute the script as follows:
@ilma_install.sql pune
2) Remotely from a client. In this case you do need to provide a connection string to your remote database instance. Therefore, you would execute the script as follows:
@ilma_install.sql pune@11
in this scenario the connection details are derived from your TNSNAMES.ORA file. If you have multiple Oracle products installed you have multiple copies of this file and it can be difficult to track down which file is being used. To point to a specific TNSNAMES.ORA I normally set three parameters:
ORACLE_HOME - points to your 11g Client installation directory
PATH - point this to the Oracle home containing SQLPlus, usually this is ORACLE_HOME/bin
TNS_ADMIN = ORACLE_HOME/network/admin
then make sure the TNSNAMES.ORA contains a reference to your identifier "11". You can test the connection by using the TNSPING utility that is part of the 11g client installation. The format for your instance would be:
TNSPING 11
this will tell you if you can connect to your instance. If there are any issues check the connection via the Net Configuration Assistant, or you can edit the TNSNAMES.ORA file directly via Notepad.
Hope this helps
Keith -
Xdb username and password while accessing servlets
Hi all,
I just installed application server 8.2. I wrote a simple login.html and a servlet program. The deployment went fine but when I access from browser and click sunbit in login page, it asks for a xdb username and password. I don't remember giving it during installation. What is this?
ThanksHint: "Search Forums" feature can be your friend :-)
http://forum.sun.com/jive/thread.jspa?forumID=129&threadID=52586 -
Usage of java.sql.Timestamp with classes12.zip and ojdbc14.jar ?
Hi all,
If i'm using java.sql.Timestamp with classes12 it is functioning perfectly,
if i'm using ojdbc14 and java.sql.Timestamp it is functioning in different way and failing to do the action..
Example : update set xxx=yy where time = my Timestamp object set in Prepared statement
Hope to see the answerhttp://forum.java.sun.com/thread.jspa?threadID=460615&messageID=2116517
Timestamp insert problem
Using the "classes12.zip" file that comes with the distribution for Oracle versions 8.1.6.x and 8.1.7.x, Oracle's DATE datatype is mapped to the "java.sql.Timestamp" class. However, the "ojdbc14.jar" driver maps DATE to "java.sql.Date", and "java.sql.Date" only holds a date (without a time), whereas "java.sql.Timestamp" holds both a date and a time. -
JDBC 4.0 and ojdbc14.jar
Hello everyone
i need to know abt jdbc-4.0 api tutorial and abt ojdbc14.jar tutorial which one is better ojdbc or classes12
Thanksojdbc14.jar is for JDK 1.4 or higher. classes12.zip
is for JDK 1.2 and 1.3.
http://www.oracle.com/technology/software/tech/java/sq
lj_jdbc/htdocs/jdbc9201.htmlYes, although only the latest version of ojdbc14.jar (10gR2, or 10.2.0.1.0) is Oracle-approved-and-supported for Java 1.5. That doesn't mean older versions don't work with newer Java, they do, at least mostly, but Oracle does not certify-and-support them. In fact, I know that the last 8.1.7 version of classes12 works very well with Java 1.4 and an 8.1.7 DB (at lease for the driver functions my company happens to use, we're pretty "plain vanilla" on that project).
For new code, you should probably be using the latest ojdbc14.jar, unless you're using an antique version of Java. -
Differenece between ojdbc14-10.2.0.2 jar and ojdbc14
Hi as i open ojdbc14-10.2.0.2 jar i find packages - core, jdbc,jpub,net,security,sql.
and in ojdbc14.jar i find an extra package gss...
whats the main difference between this 2 jars...Ok i got some solution for this....
ojdbc14.jar has a OracleConnection class which has methos as prepareCall..etc
This methods are depricated in ojdbc14-10.2.0.2 jar
so be clear not to practice connections done by using ..... class12.jar
Maybe you are looking for
-
Looking for some assistancte in GUI_DOWNLOAD
Hi there, See I have this exercise I have to do here. Basically I have to create a program that will download the contects of SBOOK to my pc. I have to use GUI_DOWNLOAD in this exercise. Also, the user will have to input the path and file name of the
-
How do i use a External hard drive?
I am new to the whole external hard drive thing an i just received one and i do not know how to use it. I tried just dragging files to it and it did not work. Do i have to use time machine to use this or How else could i use this?
-
What is the purpose of assign roles to portal please describe
what is the purpose of assign roles to portal please describe
-
Hello, I have created a new business area and granted access to a user buy going into Tools - Security option. But this business area is not accessible to the user from Discoverer Desktop. What could be the reason. I am unable to go in to the Tools -
-
HT201317 Hi, Please how do I move tiff or jpg photos from download to i photo?
Hi Can anyone help, How do i move Jpg or Tiff photographs to i Photo ? How do i move Photographs from pictures inot i Photo? I seem to ahve photographs everywhere I woild like to get them all in one place Can you help? Thanks whatever P