Home » Developer & Programmer » JDeveloper, Java & XML » ORA-1460 while working with XML (merged 3) (oracle9i)
ORA-1460 while working with XML (merged 3) [message #547252] |
Tue, 13 March 2012 10:18  |
|
Hi!
I have a problem when trying to assign the value of a VARCHAR2 variable into a XMLType: ORA-1460 unimplemented or unreasonable conversion requested.
This is my code:
----------------------------------------------------------------
FUNCTION test(
xml_string IN VARCHAR2,
type IN VARCHAR2,
path_array IN VARCHAR2)
RETURN NUMBER AS
sub_xml XMLType;
index NUMBER;
path_find VARCHAR2(300);
existNode NUMBER;
number_nodes NUMBER;
xpath_main_node VARCHAR2(200);
BEGIN
number_nodes := 0;
SELECT xmltype(xml_string) INTO sub_xml from dual;
xpath_nodo_principal := '/' || tipo || 'Response/' || tipo || 'Result/child::node()';
sub_xml := sub_xml.EXTRACT(XPATH_HEADER, NAME_SPACE_GENERAL);
IF(sub_xml IS NOT NULL) THEN
...
-----------------------------------------------------------------
The error happens at SELECT xmltype(xml_string) INTO sub_xml from dual;
I really don't understand what's exactly happening cause this code works for some cases but this happens a lot too cause my application handles a lot of information. The length of xml_string in that moment is 4119.
Also the XML code I'm working with and I detected this one always goes wrong doesn't seem to have any errors.
Please I need some help here.
Thanks in advance.
|
|
|
|
|
|
Re: ORA/1460 in XML [message #547313 is a reply to message #547294] |
Tue, 13 March 2012 12:46   |
|
Sorry about the post it was my bad i think cause i tried to send the post again after an error i got.
Oracle9i
Client 8.0.6.0.0
Server 9.2.0.8.0
FUNCTION BE_P_CONTAR_NODOS_XML(
xml_string IN VARCHAR2,
tipo IN VARCHAR2,
path_arreglo IN VARCHAR2)
RETURN NUMBER AS
sub_xml XMLType;
indice NUMBER;
path_buscar VARCHAR2(300);
existeNodo NUMBER;
cantidad_nodos NUMBER;
xpath_nodo_principal VARCHAR2(200);
Lv_mensajeError VARCHAR2(200);
BEGIN
cantidad_nodos := 0;
BEGIN
SELECT xmltype(xml_string) INTO sub_xml from dual;
EXCEPTION
WHEN OTHERS THEN
Lv_mensajeError := length(Lv_XML) ||' '|| length(xml_string) ||' '|| SQLERRM;
INSERT INTO TEMP_XML VALUES (xml_string);
COMMIT;
END;
--EL XPATH ES GENERALEMNTE EN TODOS LOS REPONSE XML IGUAL A ESTE
xpath_nodo_principal := '/' || tipo || 'Response/' || tipo || 'Result/child::node()';
--SE EXTRAE LA RESPUESTA ELIMINANDO LOS ENCABEZADOS PRINCIPALES
sub_xml := sub_xml.EXTRACT(XPATH_ENCABEZADO, NAME_SPACE_GENERAL);
--EXTRAE EL CONTENIDO DE LA RESPUESTA
IF(sub_xml IS NOT NULL) THEN
--EXTRAE EL CUERPO DEL MENSAJE
sub_xml := sub_xml.EXTRACT(xpath_nodo_principal, NAME_SPACE_NODO);
LOOP
indice := cantidad_nodos + 1;
path_buscar := path_arreglo || '[' || TO_CHAR(indice) || ']';
existeNodo := sub_xml.EXISTSNODE(path_buscar, NAME_SPACE_NODO);
IF (existeNodo = 0) THEN
EXIT;
ELSE
cantidad_nodos := cantidad_nodos + 1;
END IF;
END LOOP;
ELSE
RETURN NULL;
END IF;
RETURN cantidad_nodos;
END BE_P_CONTAR_NODOS_XML;
-
Attachment: Test.txt
(Size: 3.96KB, Downloaded 2248 times)
|
|
|
|
|
Re: ORA/1460 in XML [message #547336 is a reply to message #547323] |
Tue, 13 March 2012 14:36   |
|
Alright, it seems like someone was trying to do some weird stuff in the code when I took it from there, yeah I am not the only one working on this.
I just compiled this so it should work.
Im sorry if im causing much trouble with this Im just too busy at work, painful day.
I uploaded the code in a TXT cause the forum wont let me post it.
|
|
|
|
Re: ORA/1460 in XML [message #547342 is a reply to message #547339] |
Tue, 13 March 2012 14:59   |
|
syakobson wrote on Tue, 13 March 2012 13:43Well, maybe now you'll post function call with ALL parameters?
SY.
The xml_string was uploaded before.
The other two parameters are attached.
|
|
|
|
|
|
|
Re: ORA-1460 while working with XML (merged 3) [message #547522 is a reply to message #547498] |
Wed, 14 March 2012 09:50   |
|
syakobson wrote on Wed, 14 March 2012 07:07Spada wrote on Tue, 13 March 2012 11:18I have a problem when trying to assign the value of a VARCHAR2 variable into a XMLType: ORA-1460 unimplemented or unreasonable conversion requested.
You are not telling the whole story. Look at function declaration - parameter xml_string is a VARCHAR2 while xml you attached is way longer that 4000 characters. It can't be passed to your function. So I don't know how did you get ORA-1460.
SY.
When I do the debug the parameter it is passed without problems so I get the error ORA-1460 at this line:
SELECT xmltype(xml_string) INTO sub_xml from dual;
|
|
|
|
|
Goto Forum:
Current Time: Mon Jun 09 16:11:38 CDT 2025
|