Home » Developer & Programmer » JDeveloper, Java & XML » XML insert from forms
XML insert from forms [message #91924] Fri, 29 August 2003 04:25 Go to next message
Michel
Messages: 6
Registered: November 2001
Junior Member
Hi Guys,
I have an xml file that I want to insert into a table using the database stored objects in Forms6i on Windows2000 server.
I am using Oracle 8i DB with XSU package.
My insert script is written in PL/SQL and saved as a stored procedure in the database.
My script is running fine if I call it from SQL Plus. However, if I call it from forms (as a stored procedure with input parameters) the script runs well for the first time and if run again, the whole application freezes and I have to suppress it with CTRL-ALT-DEL. Even if I enter another time, I can't access the stored procedure or run my script again.
The code I am using is the following:

declare
charString varchar2(80);
finalStr varchar2(4000) := null;
rowsp integer;
v_FileHandle UTL_FILE.FILE_TYPE;

begin
-- the name of the table as specified in our DTD
xmlgen.setRowsetTag('BILC_IMP_LC_MVTS');

-- the name of the data set as specified in our DTD
xmlgen.setRowTag('mappings');

-- for getting the output on the screen
dbms_output.enable(1000000);

-- open the XML document in read only mode
v_FileHandle := utl_file.fopen('E:oracleora81bin','okay.xml', 'r');

loop
BEGIN
utl_file.get_line(v_FileHandle, charString);
exception
when no_data_found then
utl_file.fclose(v_FileHandle);
exit;
END;

dbms_output.put_line(charString);

if finalStr is not null then
finalStr := finalStr || charString;
else
finalStr := charString;
end if;
end loop;

-- for inserting the XML data into the table
rowsp := xmlgen.insertXML('BILC_IMP_LC_MVTS',finalStr);

dbms_output.put_line('INSERT DONE '||TO_CHAR(rowsp));
xmlgen.resetOptions;
end;

SO WHAT'S THE PROBLEM????
Re: XML insert from forms [message #91948 is a reply to message #91924] Sat, 29 November 2003 23:57 Go to previous message
amitpipudi
Messages: 3
Registered: November 2003
Junior Member
hi michel
instead of xmlgen package ,just try dbms_xmlsave package for inserting records.
use dbms_xmlsave.insertxml method..

Regards,
Amit pipudi
Previous Topic: Doubt in Message Driven Bean(urgent)
Next Topic: about ORACLE desencrypt and Java Encrypt function
Goto Forum:
  


Current Time: Fri Apr 19 01:12:27 CDT 2024