XQuery for (CLOB)-XMLType
I would like to know whether XQuery is supporting XMLType (CLOB).
It seems to be possible to apply XQuery on a sqlquery by using the command sqlquery(..) according to FOR $b IN sqlquery(..)
This however throws a parsing excpetion when I use an sql-query that contains the extract statement which is used for CLOBs
Please help !
Below a piece of code that is not running..
FOR $b IN sqlquery("select extract( doc,'/MeasurementSystems/' ).getStringVal() from V34_6jisno7sf3ksve4m5pabk33h1b X")/MeasurementSystems/MeasurementSeries/*
Marcel,
Does the extract work outside of the sqlquery and FOR loop?
Similar Messages
-
Type-mapping not working correctly, get "Unable to find a javaType for the xmlType" WARNING
I'm manually creating a web-services.xml file, and using the autogen ant task to
generate the codec XML/Java classes. The XML definition is provided by SAP.
The ant build.xml file:
<project name="buildWebservice" default="stubgen">
<target name="stubgen">
<clientgen ear="C:\projects\RMIS\ifrrequests\RMIS.ear"
packageName="com.aa.rmis.webservice.client"
clientJar="C:\projects\RMIS\ifrrequests\rmisws-client.jar"
autotype="False" />
</target>
<target name="all" depends="stubgen"/>
</project>
The problem is seen below in the output from Ant. Note the WARNINIG. The problem
is that the xml type cannot be mapped to the Java type.
C:\projects\RMIS\ifrrequests>ant -buildfile clientbuild.xml
Buildfile: clientbuild.xml
stubgen:
[clientgen] Generating client jar for RMIS.ear ...
[clientgen] WARNINIG: Unable to find a javaType for the xmlType:['urn:sap-com:do
cument:sap:business']:PaymentRequest.Create. Make sure that you have registered
this xml type in the type mapping
[clientgen] Using SOAPElement instead
[clientgen] Compiling 4 source files to C:\DOCUME~1\944377\LOCALS~1\Temp\rmisws-
client.jar-836624340
[clientgen] Building jar: C:\projects\RMIS\ifrrequests\rmisws-client.jar
BUILD SUCCESSFUL
Total time: 17 seconds
The Java source that has the implementation of the service methods is simply:
package com.aa.rmis.webservice;
import com.aa.rmis.ifr.request.*;
public class TestService
public TestService()
public int serviceRequest(PaymentRequestCreate request)
System.out.println("Received serviceRequest message");
return 0;
public void testStringRequest(String request)
The web-service.xml file is attached, which contains the schema for the SAP PaymentRequest.Create
object definition.
Another problem I have, which is probably related, is that the service method
that has a complex data type (non-built in data type) is not being deployed into
the WebLogic server. But the other service method that simply takes a String
parameter is.
The steps I took are:
1. Get XML from SAP Interface Repository (IFR) for PaymentRequest
2. Use ant task autogen to generate the request codec classes
3. Create the web-services.xml file by inserting the schema definition and the
mapping file created by the autogen task, and defining the operations
4. Build web-services.war file that contains all autogen compiled class files,
the web-services.xml file, and the service implementation class
5. Build the ear file that holds the web service files
6. Use the clientgen ant task to generate (included above) to generate the client
jar file that should contain the proxy for both of the service methods
Environment:
* WebLogic 7.02
* JDK 1.3.1_06
* JBuilder 9 Enterprise
* Ant 1.4
Possible causes:
* Namespace not being used correctly
* copied verbatim the mapping xml file generated by autogen into the web-services.xml
file
* xml-schema part of web-services.xml might not be set correctly
* operation definition might not be using the correct namespace
* Classpath used for ant might not be right
* Doubt this is the problem, but I'm out of other ideas
* Set by using the setWLEnv.cmd file provided by WebLogic
* Tried adding the generated classes directory for my project to the classpath,
but did not work
I've been referencing the Programming WebLogic Web Services document throughout
this entire process. I must be missing something.
Can anybody from BEA help me out with this problem?
Thanks in advance.
[web-services.xml]Hi JD,
I spent a few cycles looking over your web-services.xml file, however I
don't have any suggestions other that one that looks like you have
already tried, at the top, in the <schema...>
targetNamespace="urn:sap-com:document:sap:business"
Making edits to these generated files can be tricky and my only
suggestion is to create a small reproducer to run by our outstanding
support team.
A quick look at our problem database shows one issue (CR095109) related
to a similar problem at deploy time that was fixed with 7.0SP3. Again,
the support folks will be able to help focus in on the issue.
Regards,
Bruce
JD wrote:
>
The first posting contains the wrong web-services.xml file. Please refer to this
one instead.
"JD" <[email protected]> wrote:
I'm manually creating a web-services.xml file, and using the autogen
ant task to
generate the codec XML/Java classes. The XML definition is provided
by SAP.
The ant build.xml file:
<project name="buildWebservice" default="stubgen">
<target name="stubgen">
<clientgen ear="C:\projects\RMIS\ifrrequests\RMIS.ear"
packageName="com.aa.rmis.webservice.client"
clientJar="C:\projects\RMIS\ifrrequests\rmisws-client.jar"
autotype="False" />
</target>
<target name="all" depends="stubgen"/>
</project>
The problem is seen below in the output from Ant. Note the WARNINIG.
The problem
is that the xml type cannot be mapped to the Java type.
C:\projects\RMIS\ifrrequests>ant -buildfile clientbuild.xml
Buildfile: clientbuild.xml
stubgen:
[clientgen] Generating client jar for RMIS.ear ...
[clientgen] WARNINIG: Unable to find a javaType for the xmlType:['urn:sap-com:do
cument:sap:business']:PaymentRequest.Create. Make sure that you have
registered
this xml type in the type mapping
[clientgen] Using SOAPElement instead
[clientgen] Compiling 4 source files to C:\DOCUME~1\944377\LOCALS~1\Temp\rmisws-
client.jar-836624340
[clientgen] Building jar: C:\projects\RMIS\ifrrequests\rmisws-client.jar
BUILD SUCCESSFUL
Total time: 17 seconds
The Java source that has the implementation of the service methods is
simply:
package com.aa.rmis.webservice;
import com.aa.rmis.ifr.request.*;
public class TestService
public TestService()
public int serviceRequest(PaymentRequestCreate request)
System.out.println("Received serviceRequest message");
return 0;
public void testStringRequest(String request)
The web-service.xml file is attached, which contains the schema for the
SAP PaymentRequest.Create
object definition.
Another problem I have, which is probably related, is that the service
method
that has a complex data type (non-built in data type) is not being deployed
into
the WebLogic server. But the other service method that simply takes
a String
parameter is.
The steps I took are:
1. Get XML from SAP Interface Repository (IFR) for PaymentRequest
2. Use ant task autogen to generate the request codec classes
3. Create the web-services.xml file by inserting the schema definition
and the
mapping file created by the autogen task, and defining the operations
4. Build web-services.war file that contains all autogen compiled class
files,
the web-services.xml file, and the service implementation class
5. Build the ear file that holds the web service files
6. Use the clientgen ant task to generate (included above) to generate
the client
jar file that should contain the proxy for both of the service methods
Environment:
* WebLogic 7.02
* JDK 1.3.1_06
* JBuilder 9 Enterprise
* Ant 1.4
Possible causes:
* Namespace not being used correctly
* copied verbatim the mapping xml file generated by autogen into
the web-services.xml
file
* xml-schema part of web-services.xml might not be set correctly
* operation definition might not be using the correct namespace
* Classpath used for ant might not be right
* Doubt this is the problem, but I'm out of other ideas
* Set by using the setWLEnv.cmd file provided by WebLogic
* Tried adding the generated classes directory for my project to
the classpath,
but did not work
I've been referencing the Programming WebLogic Web Services document
throughout
this entire process. I must be missing something.
Can anybody from BEA help me out with this problem?
Thanks in advance.
Name: web-services.xml
web-services.xml Type: ACT Project (text/xml)
Encoding: base64 -
SQLloder scripts not getting generated for CLOBs
I am trying to migrate MYSQL 3.23 database into Oracle 8.1.7 and after creating the Oracle model and after converting the MYSQL text datatype into CLOB of the Oracle model the SQLloader scripts is not getting generated for CLOB datatypes. I mean the scripts are getting created but there is no change in the script for CLOB datatype.
The script generates the following for the table containing CLOB datatypes:
mysqldump -h <HOST> -u <USERNAME> -p<PASSWORD> -T <DESTINATION_PATH> fields-terminated-by="<ec>" lines-terminated-by="<er>" test av_wbt_course
Please let me know how to load data when the datatype is of CLOB ?I was able to resolve this issue by using OWM Oracle Migration instead of using offline method by sqlloader scripts.
-
Limitation for CLOB columns? - ORA-01704: string literal too long
Hello!
I'm trying to update a CLOB column with more than 35000 characteres, but I get "ORA-01704: string literal too long".
The code:
declare
l_clob clob;
begin
update test set test = empty_clob()
WHERE ID = 1
returning test into l_clob;
dbms_lob.write( l_clob, length('A...here 35000xA...A'), 1,'A...here 35000xA...A');
end;
Is there any limitation for CLOB columns?
Thanks for help.
Danieluser605489 wrote:
32768 characteres :)Actually it's 1 character less than 32K...
*32767*
SQL> declare
2 v_vc varchar2(32768);
3 begin
4 null;
5 end;
6 /
v_vc varchar2(32768);
ERROR at line 2:
ORA-06550: line 2, column 17:
PLS-00215: String length constraints must be in range (1 .. 32767)
SQL>I guess it comes from a legacy thing where signed words (2 bytes) are/were used to represent a value. As the most significant bit of the word is used to represent the sign of the number the range goes from -32768 to 32767. -
Using XQuery for transformation in Mediator
I have used successfully XQuery transformation in my BPEL using ora:processXQuery function. But I am struggling to use in my mediator transformations. Can any one confirm whether I can use XQuery for my mediator.. Many Thanks
You can use Saxon to execute XQuery expressions.
-
Hello Oracle-Experts,
I had to calculate hash-values for a corrorponding CLOB-field (see my post 'Buffer to small ORA-22835 error after migration from 9i to 10g' in forum 'database general').
I calculate the hash-values with the DBMS_UTILITY.GET_HASH_VALUE, e.g:
SQL> SELECT DBMS_UTILITY.GET_HASH_VALUE(LPAD('X',3998,'X'),1,POWER(2,30)) FROM dual;
DBMS_UTILITY.GET_HASH_VALUE(LPAD('X',3998,'X'),1,POWER(2,30))
1053896858
Because the calculation failed with 10g I had taken a closer look at this function and realised the following results:
VALUE DBMS_UTILITY.GET_HASH_VALUE(VALUE,1,POWER(2,30))
LPAD('X',3997,'X') 557754150
LPAD('X',3998,'X') 1053896858
LPAD('X',3999,'X') 888036750
LPAD('X',4000,'X') 162062978
LPAD('X',4001,'X') 162062978
LPAD('X',4002,'X') 162062978
LPAD('X',10000,'X') 162062978
It seems to me that I can't use this function for clob-values with a length greater than 4000 characters because of collisions. Maybe someone with experience
can give me a hint to handle this problem. Worst case i had to write my own CLOB_2_HASH function.
TIA + Best regards
MatthiasYeah, the 4000-byte limit would be a factor in working CLOBs. I if you only had 4000 bytes you would not need a CLOB in the first place.
If you don't find something better then writing your own function might be the thing to do. -
ORA-22835: Buffer too small for CLOB to CHAR or BLOB to RAW conversion
Hi all,
the following query select to_char(nvl(round(pc.target_cost*xx_primavera.geteurtolvrate,2),amount),'FM999G999G999G999G990D00') detail_amount,
nvl(ct.cost_type, description) detail_description,
tm_desc.memo_id,
primavera_prj_name detail_prj_name,
hp.party_number detail_party_number,
xpid.interface_line_attribute1,
utl_i18n.unescape_reference(replace(regexp_replace(utl_raw.cast_to_varchar2(tm_desc.task_memo), '<[^>]*>'), chr(13)||chr(10))) document_description,
REPLACE(regexp_replace(utl_raw.cast_to_varchar2(tm_id.task_memo), '<[^>]*>'), chr(13)||chr(10)) prim_memo_client_id
from XX_PRIMAVERA_INVOICES_DETAIL xpid
join admuser.xx_ar_hz_parties xahp on xahp.orig_system_bill_customer_id = xpid.orig_system_bill_customer_id
join hz_parties hp on hp.party_id = xahp.party_id
left join admuser.projcost pc on pc.proj_id = xpid.primavera_prj_id and pc.cost_type_id != 29 and xpid.service_code = 8 and pc.task_id = xx_primavera.getTaskId(xpid.primavera_prj_id,'A1020', 'Изготвяне на оферта') and delete_session_id is null
left join admuser.costtype ct on ct.cost_type_id = pc.cost_type_id
left join admuser.taskmemo tm_id on tm_id.proj_id = xpid.primavera_prj_id and tm_id.memo_type_id = 53 and tm_id.task_id = xx_primavera.getTaskId(xpid.primavera_prj_id,'A1020', 'Изготвяне на оферта')
left join admuser.taskmemo tm_desc on tm_desc.proj_id = xpid.primavera_prj_id and tm_desc.memo_type_id = 55 and tm_desc.task_id = xx_primavera.getTaskId(xpid.primavera_prj_id,'A1020', 'Изготвяне на оферта')
where amount != 0
and xpid.interface_line_attribute1 = :ra_ctp_attribute1
ORDER BY xpid.primavera_prj_name, xpid.description;returns error:
ORA-22835: Buffer too small for CLOB to CHAR or BLOB to RAW conversion (actual: 2371, maximum: 2000) I found that the error occurs in the row : utl_i18n.unescape_reference(replace(regexp_replace(utl_raw.cast_to_varchar2(tm_desc.task_memo), '<[^>]*>'), chr(13)||chr(10))) document_description,and tried to change it to: utl_i18n.unescape_reference(replace(regexp_replace(utl_raw.cast_to_varchar2(dbms_lob.substr(tm_desc.task_memo,1,2000)), '<[^>]*>'), chr(13)||chr(10))) document_description,....but it returns not value for that field... am i using dbms_lob.substr at the wrong place? The column 'tm_desc.task_memo' is BLOB type.
Any ideas how to cheat it ?
Version: Oracle Database 11g Enterprise Edition Release 11.1.0.7.0 - Production
PL/SQL Release 11.1.0.7.0 - Production
"CORE 11.1.0.7.0 Production"
TNS for Linux: Version 11.1.0.7.0 - Production
NLSRTL Version 11.1.0.7.0 - ProductionThanks in advance,
Bahchevanov.Your second example has the parameters reversed. The amount (length) comes first and then the offset:
DBMS_LOB.SUBSTR (
lob_loc IN BLOB,
amount IN INTEGER := 32767,
offset IN INTEGER := 1)
RETURN RAW;
DBMS_LOB.SUBSTR (
lob_loc IN CLOB CHARACTER SET ANY_CS,
amount IN INTEGER := 32767,
offset IN INTEGER := 1)
RETURN VARCHAR2 CHARACTER SET lob_loc%CHARSET;
DBMS_LOB.SUBSTR (
file_loc IN BFILE,
amount IN INTEGER := 32767,
offset IN INTEGER := 1)
RETURN RAW;Also, remember that # of bytes is not necessarily the same as the # of characters depending on your character set. So 2000 bytes might become 4000 characters. And you have to make sure the BLOB is actually character data and not arbitrary binary data.
Post the results of reversing the parameters and using a smaller chunk size. -
Hi All,
Can Anyone please tell how to compare clob type in select query with where condition ?
Ex: field: Desc_ short(Clob )
field ean_code(number,pk)
And i want to see those ean_code list matching to particullar clob pattern matching in the record in any where in the record.
Please help.
Thanks and regards,
DK.COMPARE function
This function compares two entire LOBs or parts of two LOBs. You can only compare LOBs of the same datatype (LOBs of BLOB type with other BLOBs, and CLOBs with CLOBs, and BFILEs with BFILEs). For BFILEs, the file must be already opened using a successful FILEOPEN operation for this operation to succeed.
COMPARE returns zero if the data exactly matches over the range specified by the offset and amount parameters. Otherwise, a non-zero INTEGER is returned.
For fixed-width n-byte CLOBs, if the input amount for COMPARE is specified to be greater than (4294967295/n), then COMPARE matches characters in a range of size (4294967295/n), or Max(length(clob1), length(clob2)), whichever is lesser.
Syntax
DBMS_LOB.COMPARE (
lob_1 IN BLOB,
lob_2 IN BLOB,
amount IN INTEGER := 4294967295,
offset_1 IN INTEGER := 1,
offset_2 IN INTEGER := 1)
RETURN INTEGER;
DBMS_LOB.COMPARE (
lob_1 IN CLOB CHARACTER SET ANY_CS,
lob_2 IN CLOB CHARACTER SET lob_1%CHARSET,
amount IN INTEGER := 4294967295,
offset_1 IN INTEGER := 1,
offset_2 IN INTEGER := 1)
RETURN INTEGER;
DBMS_LOB.COMPARE (
lob_1 IN BFILE,
lob_2 IN BFILE,
amount IN INTEGER,
offset_1 IN INTEGER := 1,
offset_2 IN INTEGER := 1)
RETURN INTEGER;
Pragmas
pragma restrict_references(COMPARE, WNDS, WNPS, RNDS, RNPS);
Parameters
Table 17-7 COMPARE Function Parameters
Parameter Description
lob_1 LOB locator of first target for comparison.
lob_2 LOB locator of second target for comparison.
amount Number of bytes (for BLOBs) or characters (for CLOBs) to compare.
offset_1 Offset in bytes or characters on the first LOB (origin: 1) for the comparison.
offset_2 Offset in bytes or characters on the first LOB (origin: 1) for the comparison.
Returns
INTEGER: Zero if the comparison succeeds, non-zero if not.
NULL, if
amount < 1
amount > LOBMAXSIZE
offset_1 or offset_2 < 1
offset_1 or offset_2 > LOBMAXSIZE
Exceptions
Table 17-8 COMPARE Function Exceptions for BFILE operations
Exception Description
UNOPENED_FILE
File was not opened using the input locator.
NOEXIST_DIRECTORY
Directory does not exist.
NOPRIV_DIRECTORY
You do not have privileges for the directory.
INVALID_DIRECTORY
Directory has been invalidated after the file was opened.
INVALID_OPERATION
File does not exist, or you do not have access privileges on the file.
http://www.java2s.com/Code/Oracle/System-Packages/Usedbmslobcomparetocompare.htm -
APEX BUG ? Buffer too small for CLOB to CHAR or BLOB to RAW
Hi
I tried use search field (right top corner) in Application Builder for my APP. After while a had:
report error:
ORA-22835: Buffer too small for CLOB to CHAR or BLOB to RAW conversion (actual: 8000, maximum: 4000)
I changed my main table and now I would like search every appearance in app, I thought it's the best solution to use search.
Do you know how resolve my problem.
APEX ver 4.0.1.00.03You can't...there's a limit of 4k for any page item in apex....attempting to convert or bring in more into a page item or even from an app process into a javascript variable, kicks that error.
It's a limitation with mod_plsql, there's a fix in 4.0 but it requires using the java listener instead of mod_plsql. -
ORA-22835: Buffer too small for CLOB to CHAR on Solaris but not Windows
Hi,
I get the following error on Solaris but not Windows equivalent 10.2 installations
ORA-22835: Buffer too small for CLOB to CHAR or BLOB to RAW conversion (actual: 4575, maximum: 4000)
ORA-06512: at line 65
the code causing the problem is:
SELECT A.TABLE_NAME, A.DEFAULT_DIRECTORY_NAME, B.LOCATION,
CASE
WHEN INSTR(A.ACCESS_PARAMETERS,'RECORDS FIXED')<>0 THEN
SUBSTR(A.ACCESS_PARAMETERS,INSTR(A.ACCESS_PARAMETERS,'RECORDS FIXED')+14,3)
ELSE NULL
END RSZ FROM USER_EXTERNAL_TABLES A, USER_EXTERNAL_LOCATIONS B
WHERE A.TABLE_NAME = B.TABLE_NAME(+);
the entire code being executed is:
DECLARE
EX BOOLEAN;
CNT NUMBER;
SQL1 VARCHAR2(4000);
FLEN NUMBER;
BSIZE NUMBER;
TABNAME VARCHAR2(4000);
DEFDIR VARCHAR2(4000);
RSZ VARCHAR2(4000);
ECODE NUMBER(38);
ERRMSG VARCHAR2(4000);
CURSOR C1 IS
SELECT A.TABLE_NAME, A.DEFAULT_DIRECTORY_NAME, B.LOCATION,
CASE
WHEN INSTR(A.ACCESS_PARAMETERS,'RECORDS FIXED')<>0 THEN
SUBSTR(A.ACCESS_PARAMETERS,INSTR(A.ACCESS_PARAMETERS,'RECORDS FIXED')+14,3)
ELSE NULL
END RSZ FROM USER_EXTERNAL_TABLES A, USER_EXTERNAL_LOCATIONS B
WHERE A.TABLE_NAME = B.TABLE_NAME(+);
TYPE C1_TYPE IS TABLE OF C1%ROWTYPE;
REC1 C1_TYPE;
BEGIN
OPEN C1;
FETCH C1 BULK COLLECT INTO REC1;
FOR I IN REC1.FIRST .. REC1.LAST
LOOP
UTL_FILE.FGETATTR(NVL(REC1(I).DEFAULT_DIRECTORY_NAME,'CARDSLOAD'),
REC1(I).LOCATION, EX, FLEN, BSIZE);
IF EX THEN
IF INSTR(TO_CHAR(REC1(I).RSZ),'\.')<>0 THEN
DBMS_OUTPUT.PUT_LINE('INVALID RECORDSIZE OR CORRUPTED FILE');
END IF;
DBMS_OUTPUT.PUT_LINE('Table Name: ' || TO_CHAR(REC1(I).TABLE_NAME));
DBMS_OUTPUT.PUT_LINE('File Exists '||REC1(I).LOCATION);
DBMS_OUTPUT.PUT_LINE('File Length: ' || TO_CHAR(FLEN));
DBMS_OUTPUT.PUT_LINE('Record Size: ' || TO_CHAR(REC1(I).RSZ));
DBMS_OUTPUT.PUT_LINE('Block Size: ' || TO_CHAR(BSIZE));
DBMS_OUTPUT.PUT_LINE('# RECORDS: ' || FLEN/TO_NUMBER(REC1(I).RSZ));
BEGIN
CNT:='';
SQL1:='SELECT COUNT(*) FROM '|| REC1(I).TABLE_NAME;
EXECUTE IMMEDIATE SQL1 INTO CNT;
DBMS_OUTPUT.PUT_LINE('SELECT COUNT FOR: ' || REC1(I).TABLE_NAME||' = '||CNT);
EXCEPTION
WHEN OTHERS THEN
DBMS_OUTPUT.PUT_LINE('SELECT COUNT FAILED FOR: ' || REC1(I).TABLE_NAME);
ECODE := SQLCODE;
ERRMSG := SQLERRM;
DBMS_OUTPUT.PUT_LINE(ECODE||' '||ERRMSG);
END;
ELSE
DBMS_OUTPUT.PUT_LINE(REC1(I).TABLE_NAME||' '||REC1(I).LOCATION||' File Does Not Exist');
END IF;
DBMS_OUTPUT.PUT_LINE('-----------------------------------------------------');
END LOOP;
CLOSE C1;
EXCEPTION
WHEN OTHERS THEN RAISE;
END;
Any ideas why Solaris but not Windows would have this problem?
Thanks,
VictorCheck out Bug 4715104 - ORA-22835 / truncated data from USER/ALL/DBA_EXTERNAL_TABLES
-
Report error: ORA-22835: Buffer too small for CLOB to CHAR or BLOB to RAW c
report error:
ORA-22835: Buffer too small for CLOB to CHAR or BLOB to RAW conversion (actual: 7106, maximum: 4000)
Has anyone come across this error?
We're inputing text using the HTML Editor Minimal. The text is saving fine, but large text inputs, when combined with the html tags, cannot be retrieved from the database, i just get the above error. I believe there is an associated DB bug for this, but i'm curious if anyone has come across this before, and if they found a work-around?Did you solve this?
I have a similar problem, as posted in CLOBs Quit Working Due to > 4000 chars - ORA-22835
Thanks,
--BobC -
What control i can use for Clob datatype in forms?
Hi,
Backend side
I had created a table that having a column namely sql_text which hold the query string and defined as CLOB data type.
On Form 6i
Just i created a textitem(long) for the clob datatype field
but it only hold very limited length of charter, i want to be more. Any other control is there?
please guid me what should i want to do.
kanishThere is limited support for CLOBs in Forms. I guess you could read it in piecemeal with a procedure using the DBMS_LOB package
-
How to create an XQuery for an XML type data source
Hi,
1.I have data contained in an XML format.
Hence I have created a physical data source for XML type data.
2.I have created a logical view to broker data from several disparate physical data sources.I have called this as UnifiedView.
3.I have created a function called getUnifiedView() to obtain data from all the physical sources
4.Upto this point, I have not faced any problems.
5.However when i try writing a simple XQuery for the physical XML datasource such as
$Sh-data/PublicIdentifiers/MSISDN="1234567"
I get result as (For example):
<HSS>
<MSISDN> 1234567 111111 222222 </MSISDN>
</HSS>
Could you please help me getting the where clause output?
I have attached the schema and XML files used for further information.
Regards
VidyaHi mReiche,
I later on resolved the previously mentioned error and try out the XQuery as suggested by you.
for $MSISDN in ns0:Sh-data()/PublicIdentifiers/MSISDN
where $MSISDN="1234567"
return
<HSS>
<MSISDN>{data($MSISDN)}</MSISDN>
</HSS>
It works! Thanks.
Now i am trying to retrieve data from 2 XML documents and an LDAP query.
I have the following data sources:
1.LDAP queried by Java Function
2.HSS xml
3.Presence xml
I want to match the telephoneNumber of the LDAP with MSISDN in the HSS.xml.
Next i want to match the SIP_URI in the HSS.xml with Contact of the Presence.xml
Given below is the XQuery which i have written to achieve the above:
for $x0 in ns5:FindDN($str_mailId)
for $Sh-Data in ns2:Sh-Data()
where $x0 = $Sh-Data/PublicIdentifiers/MSISDN
for $presence in ns3:presence()
where $Sh-Data/Sh-IMS-Data/SCSCFName = $presence/ns4:tuple/ns4:contact
return
On executing this XQuery i am getting the following error:
java.lang.NullPointerException: null
at weblogic.xml.query.types.XQueryAtomicType.commonSuperTypeOf(XQueryAtomicType.java:150)
at weblogic.xml.query.types.XQueryType.comparisonTypeOf(XQueryType.java:324)
at weblogic.xml.query.runtime.compare.GeneralAtomicComparison.compare(GeneralAtomicComparison.java:50)
at weblogic.xml.query.runtime.compare.ComparisonIterator.fetchNext(ComparisonIterator.java:50)
at weblogic.xml.query.iterators.GenericIterator.next(GenericIterator.java:113)
at weblogic.xml.query.runtime.logic.BoolEffValue.exec(BoolEffValue.java:51)
at weblogic.xml.query.runtime.logic.BoolEffValue.fetchNext(BoolEffValue.java:47)
at weblogic.xml.query.iterators.GenericIterator.next(GenericIterator.java:113)
at weblogic.xml.query.runtime.core.IfThenElse.fetchNext(IfThenElse.java:79)
at weblogic.xml.query.iterators.GenericIterator.next(GenericIterator.java:113)
at weblogic.xml.query.runtime.core.CountMapIterator.fetchNext(CountMapIterator.java:162)
at weblogic.xml.query.iterators.GenericIterator.next(GenericIterator.java:113)
at weblogic.xml.query.runtime.core.CountMapIterator.fetchNext(CountMapIterator.java:162)
at weblogic.xml.query.iterators.GenericIterator.next(GenericIterator.java:113)
at weblogic.xml.query.runtime.sequences.Exists.fetchNext(Exists.java:40)
at weblogic.xml.query.iterators.GenericIterator.next(GenericIterator.java:113)
at weblogic.xml.query.runtime.core.IfThenElse.fetchNext(IfThenElse.java:79)
at weblogic.xml.query.iterators.GenericIterator.next(GenericIterator.java:113)
at weblogic.xml.query.runtime.core.LetIterator.fetchNext(LetIterator.java:133)
at weblogic.xml.query.iterators.GenericIterator.next(GenericIterator.java:113)
at weblogic.xml.query.runtime.core.LetIterator.fetchNext(LetIterator.java:133)
at weblogic.xml.query.iterators.GenericIterator.next(GenericIterator.java:113)
at weblogic.xml.query.runtime.querycide.QueryAssassin.fetchNext(QueryAssassin.java:54)
at weblogic.xml.query.iterators.GenericIterator.peekNext(GenericIterator.java:151)
at weblogic.xml.query.runtime.qname.InsertNamespaces.fetchNext(InsertNamespaces.java:161)
at weblogic.xml.query.iterators.GenericIterator.next(GenericIterator.java:113)
at weblogic.xml.query.runtime.core.QueryIterator.fetchNext(QueryIterator.java:127)
at weblogic.xml.query.iterators.GenericIterator.hasNext(GenericIterator.java:134)
at weblogic.xml.query.xdbc.util.Serializer.serializeItems(Serializer.java:142)
at com.bea.ld.server.QueryInvocation.getResult(QueryInvocation.java:461)
at com.bea.ld.EJBRequestHandler.executeFunction(EJBRequestHandler.java:346)
at com.bea.ld.ServerBean.executeFunction(ServerBean.java:108)
Please find attached the XML documents which i am using.
Could you pls let me know how to resolve this. -
XQUERY against an XMLTYPE variable
I have a procedure which gets xmltype instance and i have to use xquery upon that variable.
declare
myxml xmltype;
s varchar2(20);
begin
myxml:=xmltype('<person><name id="1" age="23"/><name id="2" age="25"/></person>');
SELECT
XMLQuery(
'for $i in /person
where $i/age > 24
return $i/id'
PASSING myxml RETURNING CONTENT) into s
FROM DUAL;
end;
BUT i get this error
ORA-06550: line 6, column 1:
PLS-00801: internal error [*** ASSERT at file pdw4.c, line 793; Cannot coerce
between type 43 and type 30; anon_68F441E0__AB[6, 1]]
Please help it is urgentNot sure if you ever received your answer regarding how to pass an XMLType variable in PLSQL to an XQuery command.
Here is an example of what I've been using... in Oracle 10.2.0.1
SET SERVEROUTPUT ON SIZE 200000
DECLARE
l_result XMLType;
l_xxDoc XMLType := XMLType(
<root>
<things>
<somestuff>12345</somestuff>
<morestuff>12345</morestuff>
</things>
<things>
<somestuff>dfgdfg</somestuff>
<morestuff>werwer</morestuff>
</things>
</root>
PROCEDURE printClobOut
(p_result IN CLOB)
IS
v_xmlstr VARCHAR2(32767);
v_line VARCHAR2(2000);
BEGIN
v_xmlstr := DBMS_LOB.SUBSTR(p_result,32767);
LOOP
EXIT WHEN v_xmlstr IS NULL;
v_line := SUBSTR(v_xmlstr,1,INSTR(v_xmlstr,CHR(10))-1);
DBMS_OUTPUT.PUT_LINE('| '||v_line);
v_xmlstr := SUBSTR(v_xmlstr,INSTR(v_xmlstr,CHR(10))+1);
END LOOP;
END;
BEGIN
select XMLQUERY(
'for $a in $TheDoc/root
return <theresult>
{$a/things}
</theresult>
PASSING l_xxDoc as "TheDoc"
RETURNING CONTENT) into l_result
from dual;
printClobOut(l_result.extract('/').getClobVal());
END;
Kevin -
DB Link between Oracle 10g and Oracle 9i for CLOB data type
How do I transport XMLType or CLOB from oracle 9i to Oracle 10G using DBLink?
Is any restrction to DBLink, while transfering CLOB with XML data from oracle 9i to Oracle 10G?
Please let me know how i resolve this issue.
Thanks in advance.
DKWell... it depends on what type of link you wish to create.
If you have same user with same password on both databases (9i and 10G), then you can create a public database link as
CREATE PUBLIC DATABASE LINK dblink USING 'dbalias';
Note: dbalias is the value from your TNSNAMES.ORA. The database from which you are creating the db link has to have the entry in TNS for other database.
Other method is to create a private db link
CREATE DATABASE LINK dblink CONNECT TO user IDENTIFIED by pwd using 'dbalias';
The number of open connections from a particular database is governed by init parameter DB_LINKS (this was in 8i.. not sure about higher versions)
HTH...
Message was edited by:
satishkandi
Maybe you are looking for
-
While logging I am getting error ORA-12154:
I am getting this error, while logging. ERROR: ORA-12154: TNS:could not resolve service namePls Wat I need to do,
-
Problem with creating oracle database
I am trying to create a new database in one of customers computers, using Database Administration Assistant. The wizard goes until "Adding Oracle Text" then I get an error message without any description. Then jump out of wizard quickly with no other
-
Avoid local member from shared row axis report
Hi, I have developed reports, and shared onereport with default report with row axis, when i merge the two report the local member applicable to the another report which will i don't required the formula. but one report don't need sum function at the
-
Error when run Depreciation Posting Run AFAB
Hi, I found error when run Depreciation Posting Run for period 7 2007. FYI. I had run Unplanned Depreciation (TCode: ABAA) with document date 31.10.2007 and posting date 31.10.2007, trans. type 640. After that, i want to run Depreciation Posting Run
-
When launching a Captivate piece from the web, what are the pros and cons of launching the .swf versus using the HTML file Captivate creates for you? When I launch the .swf it opens a window the same size as the window launching it. Of course it can