XML insert from forms

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:\oracle\ora81\bin','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;

Lets take for example you are having the response in following format
response := '<Response>
<r><name></name><r>
<r><name></name><r>
</Response>'
Convert it to XMLTYPE using the following
xml_type := XMLTYPE(response);
select extractvalue(xml_type,'/Response/r[1]/name') into result from dual;
'1' in [1] refers to the index of the similiar node.(r node)

Similar Messages

  • URGENT !! Calling a XML document from FORMS 6i

    Hello Friends,
    I have created a Help system based on a WORD Document for my application in as a XML file . Coudl any of you be kind enough to et me kow how can I invoke this HELP file based on parametes from my application built in FORMS 6i.
    Its urgent , it will be kind if anyoen of you coud help me in this .
    Expecting a answer from you all.
    Regards,
    Anurag Sharma

    If you are running on the Web try using the Web.Show_document built in.
    If you are in C/S try the Host built-in.

  • [b]Urgent How to send XML file from forms 6.0 to a url to access database[/

    hi
    i need to create an XML with some values file from Oracle Forms 6.0 and then send this XML file To a URL to access the database,which in turn will send me XML file with new values.Can any body help me out as i don't have any ideas
    Regards
    Sunil

    Sunil,
    and this must be using a URL and can't be handled by a database stored procedure ?
    Anyway, your scenario can be achieved using teh Java Importer in Forms 6i and above. You woudl write a Java program that takes a String and loads it to an URL. It then checks the response URL for its content.
    Frank

  • XML structure from Form Based Published Document

    Hi experts,
    I want to read the contents of a Form Based XML Document to my Web Dynpro project. I'm using this code to do so:
        wdContext.currentContextElement().setText(wdContext.currentTableContentElement().getObjectName());
        readXML(wdContext.currentTableContentElement().getLink());
    IWDClientUser wdClientUser = WDClientUser.getCurrentUser();
    com.sap.security.api.IUser sapUser = wdClientUser.getSAPUser();
    //create an ep5 user from the retrieved user
    com.sapportals.portal.security.usermanagement.IUser ep5User = WPUMFactory.getUserFactory().getEP5User(sapUser);
    IResourceContext context = new ResourceContext(ep5User);
    /Specify the path of ur document here./
    RID pathRID = RID.getRID(wdContext.currentTableContentElement().getLink());
    IResource resource = ResourceFactory.getInstance().getResource(pathRID,context);
    InputStream in;
    in = resource.getContent().getInputStream();
    ByteArrayOutputStream out = new ByteArrayOutputStream();
    byte[] buffer = new byte[4096];
    int bytesread = 0;
    while ((bytesread = in.read(buffer)) != -1) {
    out.write(buffer, 0, bytesread);
    String myData = out.toString();
    wdContext.currentContextElement().setText2(myData);
    The problem now is: When I'm reading the contents of a Form Based XML Document I'm getting HTML code from the document.
    When I try to do the same with an XML document that wasn't created by a XML Form, I get the contents in default XML markup.
    My question is: how can I get the Form Based XML Document to my Web Dynpro Project in default XML markup?
    Thanks,
    Edwin van der Palen

    Hi E.,
    I guess this an XML namespace issue. I'm creating XmlForms-style documents and had to add an XML namespace to my root element to make them visible as such:
    Namespace xf = Namespace.getNamespace("xf", "http://www.sapportals.com/wcm/app/xmlforms");
    root.addNamespaceDeclaration(xf);
    So what I'd suggest to you is reading out the IResource and treating the content as XML:
    Document document = new  SAXBuilder().build(content.getInputStream());
    Element root = document.getRootElement();
    Namespace xf = Namespace.getNamespace("xf", "http://www.sapportals.com/wcm/app/xmlforms");
    root.removeNamespaceDeclaration(xf);
    Hope this helps!
    regards,
    Christian

  • XML data from Form?!?!

    I've used LD8.0 to create a feedback form for my customers (it's at http://www.raven-multimedia.com/Feedback.pdf for reference). The first time I created it it was fairly large (1.4MB) and when a user clicked the submit-by-email button the data file attached to the message was a very small XML file {which I had no problem importing into my form to get the results}.
    In fiddling with the form to try to make the file online smaller I've done SOMETHING which has resulted in a smaller form (now about 590kb), but when submitted by email the
    entire form
    is attached in PDF format!
    How do I (or is there any way to...) keep the form itself SMALL and make sure that the data file sent to me is XML (thus small) too?!?!
    I'm also interested in making the form as compatible as possible, which means an earlier version of Acrobat, but again run up against the problem that earlier version seems to mean larger file size.
    Any and all help will be appreciated!
    Thanks in advance,
    Jim 8^O
    PS- Oh, hey, can anyone tell me why I can't import Text data to my form?!?!

    He that can have patience can have what he will.
    The size of the image you embedded is overkill!
    Try resizing the original image to about 100*120 px (not sure about the exact size). Remove the original image, embed the resized one. This way you may save another 400 KBytes. In the image's 'draw'-tab select 'use original size'.
    Also, do not save the image as jpg but gif. You don't need to use jpg as the image does not feature lots of different colors. That one may save you another... 30 KBytes at least.
    You want to send XML data? Follow these steps
    Sending complete PDF on eMail-submit but instead of 'PDF', select 'XML' in the options.

  • Not able insert ,query data from forms

    hi,
    I am not able to insert data or query data from forms(10g devsuite).getting error frm-40505,frm 40508 .i am able to insert and select record from sql plus.the block ihave created is control block .it is connected to the table using the properties.
    should i do anything to insert record.please help

    the block ihave created is control block .it is connected to the table using the properties.A Control Block, by definition, is a non-database block. This means the block is not directly connected to a table so you have to manually display data in the block and any DML you want to perform on data in this block you must do manually as well.
    There are four database objects you can base your database block on; 1) a Table, 2) a View, 3) From Clause Query (basically an In-line View), and 4) a database stored procedure. I recommend you use one of these four methods rather than manually display your data.
    Craig...

  • Get xml data from a web service into Forms?

    Hello folks! I am reading active directory info from a web service into forms via imported java classes. I can read from functions that return strings just fine, but I have to get the output from getGroupUsers which returns an XmlDataDocument. How do I read this in and parse it in Forms?
    I will be grateful if y'all could point me to an example.
    Thank you,
    Gary
    P.S. Here is a snippet of how I get the full name by passing an ID:
    DECLARE
    jo ora_java.jobject;
    rv varchar2(100);
    BEGIN
    jo := ADSoapClient.new;
    rv := ADSoapClient.getUserName(jo, 'user_ID');
    :block3.fullname := rv;

    Hello,
    Since you are already dealing with server-side JAVA, I would suggest you create a method that would do the parsing server-side and what your PL/SQL will be dealing with is just the return string.
    Here is a method I use to read an XML file (actually, it is an Oracle Reports file converted to XML) and from the string version, I will do search, replace and other things.
    So, from getGroupUsers which returns an XmlDataDocument, you can adapt this method to get your data server-side and let the form module read the output data.
    <blockquote>
    private String processFileXml(String fileName, int iFile) throws ParserConfigurationException, SAXException,
    IOException, XPathExpressionException{
    try{                
    DocumentBuilderFactory domFactory = DocumentBuilderFactory.newInstance();
    domFactory.setNamespaceAware(true);
    InputStream inputStream = new FileInputStream(new File(fileName));
    DocumentBuilder builder = domFactory.newDocumentBuilder();
    Document doc = builder.parse(inputStream);
    StringWriter stw = new StringWriter();
    Transformer serializer = TransformerFactory.newInstance().newTransformer();
    serializer.transform(new DOMSource(doc), new StreamResult(stw));
    return stw.toString();
    catch (Exception e){
    System.err.println(e);
    System.exit(0);
    return "OK";
    </blockquote>
    Let me know if this is of nay help.
    Thanks.

  • How to run an XML Report from Oracle Forms 10G

    Hello Friends,
    I am in need of showing a xml report output through a button press trigger in Oracle Forms10G.
    I have designed the report in XML Publisher and the report looks fine.I found few scripts useful in running the Oracle Report from Oracle forms10G like Run_Report_Object.But I am not aware of any script that could run a XML report and show the output directly from a Form.
    All I want is to run a XML report from an Oracle Form with a button press trigger and show the output in an html version.
    Can this be achieved?
    If so, Kindly advise as this is an immediate work.
    Regards,
    Badrul.

    Hi,
    If I am not wrong the XML publisher is same as BI publisher ...
    There is one document which explains how to integrate using web service
    You want to check this
    http://www.oracle.com/technology/products/xml-publisher/docs/Forms_BIP_v22.pdf
    or you can also try web.show_document ..

  • How to change  XML  Structure from one form to another form using OO ABAP.

    Hi Experts,
    In my Scenario, i need to do ABAP Mapping in order to change Incoming structure from one form to another.
    My Input to ABAP Mapping (OO ABAP Program)would be :
         <A>..........</A>
         <B>..........</B>
         <C> .........</C>
         <D>..........</D>
         <E>..........</E>
         <F>..........</F>
    OO ABAP Program need to read this input and change the XML Structure into below form:
         <A>..........</A>
         <B>..........</B>
         <C> .........</C>
          <X>
                <D>..........</D>
                <E>..........</E>
          <F>...............<F>
    Please provide inputs (sample Code) to solve this issue.
    Thanks,
    Kish.
    Edited by: Kishore Reddy Thamma on Jan 22, 2008 2:51 PM
    Edited by: Kishore Reddy Thamma on Jan 22, 2008 2:52 PM

    Hi,
    Please provide sample code or Material for converting XML Structure from one form to another using OO ABAP and
    Steps for ABAP MAPPING.
    Thanks,
    Kish.

  • Insert XML content  from BLS to oracle table

    Hi,
    Is there any way to send XML content from BLS to Oracle table. I tried with FixedQueryWithOuput. It works, but it has limitation, it cannot take more than 4000 character , even though the param is configured as clob in oracle database side?

    Sajjad
    This is not issue from xMII-side itself, instead this is an Oracle issue itself. This has some limitation in manipulating data in Database.
    Managing CLOBs and BLOBs in JDBC is not very simple when compared to managing small amount of data. The way the CLOB and the BLOB objects are created and managed is different than a VARCHAR(String) column. In fact, Oracle extension classes are provided to support these types objects in JDBC like oracle.sql.CLOB, oracle.sql.BLOB etc.
    The new enhancements in Oracle JDBC 10g promises to simplify the insertion and retrieval techniques for the CLOBs using the standard APIs. This document enumerates how easily the CLOB data can be handled in JDBC, by harnessing the new features of the Oracle JDBC 10g driver
    Anyway, to more get info on Oracle problems u may read  <a href="http://www.oracle.com/technology/sample_code/tech/java/codesnippet/jdbc/clob10g/handlingclobsinoraclejdbc10g.html">this</a>
    Regards
    Som

  • Read/write xml data from/to adobe livecycle forms (pdf)

    Hello,
    I need some help reading xml data from pdfs created by Adobe LiveCycle and also writing xml data back to the form.
    The forms have been created using PROD LC 8.2 and in the future they will be created using PROD LC 9.5.
    I am using Visual Basic .NET to access the data programatically.
    Can anyone help me with some hints? A library, SDK? Any information would be very helpful.
    I am quite new with this Electronic Forms issue and I do not even know where to start.
    Thank you,
    Ionel

    Hi lonel,
    Do you want an online solution?
    I mean, it follows this workflow:
    1. The user will open the PDF by clicking a link, and a server-side program will generate the PDF and prepopulate it with data from some data sources, and render the PDF to the client (Browser),
    2. The user will fill the PDF.
    3. The user will click a Submit button and save the PDF and Data on the server.
    4. If the user wants to edit the Submitted Form, he will click a link to open the save PDF and possibly prepopulate some fields with data from other data sources, and complete the cycle of filling and saved the PDF and Data on the server.
    5. While the user is filling the PDF (inside a Browser), there might be a need to perform some lookup on the server, and update the form parts accordingly as a result of the lookup process.
    For 1-4 above, I have developed a complete base library using ASP.NET which helps you to perform the above.
    You can goto my Google Workspace and you will find a bunch of documents, sample PDFs, collections and VB Classes. To best view them, login using some Google Account.
    For point 4 above, one way to perform this effect, is to regenerate the required XML Data (which has the saved data before and the new lookup data), remerge the entire XML result with and empty PDF Form, and render the XFA (PDF Form) back to the client. But, if the PDF has one or more signatures, it will not work. So, in this case, you can update the Form Fields of a Saved PDF Form with new Data from the server, but the net effect is that you will have to loose all the signatures that were added on the PDF before.
    For 5 (above) there are 3 methods:
    1. Using a Web Service as a Data Connection. This is very easy if you have a traditional Web Service. I have used this method several times and will use it again if the need be. But, there is a problem. If the result of the Web Service is an Array of some Data, and you want to remerge the XFA to get the required effect after executing the web service ... and ... if there are some Drop-Down-List (DDL) fields, the bindings of the DDL Items of those fields will be lost. But, you can rebuild them (on enter event of the DDL Field)  if you have saved them in the embedded XML Data.
    2. You can update few (not many) fields while the PDF is opened (under the Browser via IFRAME) by passing the new field values using the URL Query String method. I have not done this, but I like this method, and I think it is cool. You need to write a server side code to ensure the the new filed values are passed back to the client using the correct URL with the Query String, and you need to write some javascript code inside the PDF to parse the URL and get the new field values and update them accordingly. See this as an example:
    http://www.halnesbitt.com/pages/pdfqs.php
    3. This method is very advanced and uses message communication ques between the Browser and the PDF (which is opened inside IFRAME element) using HostContainer object. This method will enable 2-way communication between the Browser and the PDF on the client side using javascript. I'd love to use this method one day. See example here:
    http://www.windjack.com/WindJack/Browser2PDF/brwsr2acroJS.htm
    I hope this will be of help to you.
    Tarek.

  • Any way to insert the XML generated from dataTable into the oracle?

    Hi guys,
    I want to know if there is a way to insert the XML generated from dataTable(dataTable.GetXML()) into the oracle?
    Thanks in advance,

    There is o extractor to load assessment cycles; instead you can load dtaa after the assesment cycle is complte in R/3. You can schdeule the job in BW accordingly.
    May I know what exactly is the requirement.
    Ravi Thothadri

  • Can we use XML from Forms 6i?

    Can we use XML from Forms 6i?

    Did you mean: can you parse an XML document within Forms 6i? With the new Java importer support, you should be able to use the Oracle XML parser for Java to do this.

  • Acrobat Professional 8 - How do you open XML sent from an online form?

    Hello,
    I have a simple question.
    How does and end user with the latest Adobe Reader, open up XML data that was emailed to them from an online website form?
    Is there a better way of going about this? For example, is it possible to create an online form through (Acrobat Professional and LiveCycle) that will allow the end user to save the PDF to their desktop (with the data nested in the fields) and then email off to the recipient of the form?
    Thanks in advance for tips and suggestions.
    Regards,
    Jim

    Hello Aandi,
    Yes, I now have the latest Adobe Reader and I believe there are add-ons that can be obtained, but I think you are right, there is no way to import the XML data from a form into the PDF using the Reader. But, I think there is a way to save the original PDF, so that the end user can now save the PDF locally (using the Reader) with data entered into the form. Then, the form can be emailed back to the originator. I think it has something to do with usage right settings in LiveCycle/Acrobat Professional.
    Anyway, thanks for your reply. It is appreciated.
    -J

  • Create an XML document from a HTML form???

    Good morning, is it possible to create an XML document from a HTML form
    if yes, can someone tell me how to proceed exactely, I would be very thankful!

    Hi,
    A very simple intro at this link. Apologies for anything unclear.
    http://cswww.essex.ac.uk/TechnicalGroup/TechnicalHelp/xmlCreate.htm
    best
    kev

Maybe you are looking for

  • You want to downgrade because the new updates won't work? Read this.

    First of all, I'm not any kind of techie person, I just have gone through this horrible experience of not being able to get into the itunes store at all after downloading the last 2 updates (7.4.2.4 and 7.4.3.1). Once I downgraded to 7.3.2.6 I was ba

  • Itunes wont start on windows xp

    i reinstalled itunes but it wont open now i even tried this source  http://support.apple.com/kb/TS1776 and deleted SC info.sidb and restart my computer but it still not opening up. i have reinstalled itunes more than 2 times and also deleted apple se

  • Macromedia Flash won't work

    Hello, Folks, I am having problems with any webpage that uses "flash" animation. (Please be kind- I know mechanics and hands-on things, but have a hard time with computers!) I have read some of the threads here that deal with a similar topic, but don

  • Importing class files

    Hi, I'm new to Eclipse and need help. I have been given a folder with 5 classes and 1 class with a main method. My first question is: Is there a way to import these classes into eclipse and run the main class with main method? I don't have any java f

  • I am having trouble printing in duplex on my HP Color LaserJet CP2025 printer.

    I have a problem printing in duplex!  I am using a Dell Studio XPS8100 computer running the 64bit version of Windows 7 with Service Pack 1 installed.  I am connected to the printer thru an AT&T router.  When I print the first few pages then go to fli