How can I inserting file's line into a oracle table in physycal order

How can I insert the file's line into a oracle table in the same physycal order that they exists in the file ?
I am using "SQL to FILE" km to performing file load into Oracle table, but the order which the records are insered into the oracle table doesn't match with the order of file's lines
How can I guarantee the same file's physycal order in the oracle table( target ) and file( source ) ?
Is it possible throught ODI ?
Thanks,
Luciana

Hi,
although I understand why use "File to Oracle( SQLLDR )" KM, I haven't the guarantee that in the agent's machine the Oracle Client installed and because when I openned the others projects I saw that anyone in my company use this KM( "File to Oracle( SQLLDR )" )
Tha's why I ask for anyone lead me whith the modification of the previous post in the "uLKM File to SQL", specifing the km step e where put the RECNUM pseudo column
This is fundamental for my ODI project
When I try to alter the "Create Work Table" and "Load Data" step of my "uLKM File to SQL" km, the execution returned me the error below:
=====================> Create Work Table Step
create table <@= vWorkTable @>
     C1_LINHA_ARQ     VARCHAR2(500) NULL, RECNUM NUMBER(10)
=====================> Load Data Step
select     LINHA_ARQ     C1_LINHA_ARQ
from      TABLE
/*$$SNPS_START_KEYSNP$CRDWG_TABLESNP$CRTABLE_NAME=ARQ_INSS2SNP$CRLOAD_FILE=/arquivos_odi/ccrs/in/#CCRS_CAD_INSS.vpNOME_ARQUIVOSNP$CRFILE_FORMAT=DSNP$CRFILE_SEP_FIELD=09SNP$CRFILE_SEP_LINE=0D0ASNP$CRFILE_FIRST_ROW=0SNP$CRFILE_ENC_FIELD=SNP$CRFILE_DEC_SEP=SNP$CRSNP$CRDWG_COLSNP$CRCOL_NAME=LINHA_ARQSNP$CRTYPE_NAME=STRINGSNP$CRORDER=1SNP$CRLINE_OFFSET=1SNP$CRLENGTH=500SNP$CRPRECISION=500SNP$CR$$SNPS_END_KEY*/
insert into ODI_RUN_CONV.C$_0TMP_ODI_INSS_DADOS_ARQ
     C1_LINHA_ARQ, RECNUM
values
     :C1_LINHA_ARQ, RECNUM
=====================
984 : 42000 : java.sql.BatchUpdateException: ORA-00984: column not allowed here
984 : 42000 : java.sql.SQLSyntaxErrorException: ORA-00984: column not allowed here
java.sql.BatchUpdateException: ORA-00984: column not allowed here
     at oracle.jdbc.driver.DatabaseError.throwBatchUpdateException(DatabaseError.java:629)
     at oracle.jdbc.driver.OraclePreparedStatement.executeBatch(OraclePreparedStatement.java:9409)
     at oracle.jdbc.driver.OracleStatementWrapper.executeBatch(OracleStatementWrapper.java:211)
     at com.sunopsis.sql.SnpsQuery.executeBatch(Unknown Source)
...Thanks again gyus,
Luciana
Edited by: 933810 on 31/05/2012 06:04
Edited by: 933810 on 31/05/2012 06:07
Edited by: 933810 on 31/05/2012 06:14

Similar Messages

  • I have powerpoint for Mac on my imac.  I can't seem to get the active text box function to work like it did on my PC.  How can I insert an active textbox into a presentation that will allow me to type while presenting?

    I have powerpoint for Mac on my imac.  I can't seem to get the active text box function to work like it did on my PC.  How can I insert an active textbox into a presentation that will allow me to type while presenting?

    I've gotten a little further on this. The dynamic select is
    working fine. It's the "a href" code that isn't. I'm wondering if
    someone can look at this line and tell me if it's okay to build the
    query string this way. The storeid comes through fine but I'm still
    not getting the employeeid value to pass. Here's line that's not
    working:
    td><a href="registerStoreCust.php?storeid=<?php echo
    $row_storeRS['storeid']; echo "&employeeid="; echo
    $_GET['employeeLM']; ?>">Register
    Customer</a></td>

  • How can I insert an existing ApDiv into a tab in the Spry Tabbed Panel?

    I have 5 of them all containing nested Apdiv within nested ApDivs (a long storie ) that I would like to insert into 5 tabs in the Spry Tabbed Panel.
    Please help.

    "Hi Gramp,I realize I have made hard work for myself but I really don't know any better. I also realize now that taking on this project may have been a mistake :-)I taught myself how to use the design side of Dream Weaver. These five ApDivs were created in the content area of the spry tool and it worked fine. (yes a lot of work though)For the first time I looked at the code side. I wanted to try to bring a peace of code from another page for something unrelated and when it didn't work I took it out and without noticing, deleting a line from the Spry tool.Of course like a classic newbe I was working without a backup copy so here I am. Loosing hours of tedious work and on the verve of tears :-)I do have some  questions though.  My APDiv
      What does "apDiv1" stands for and what does "My APDiv" stands for?Is the only thing I have to do is changing this line for my five ApDivs and paste it in the appropriate places in the code? Thanks again,Gilaad
    Date: Sat, 16 Jun 2012 20:39:07 -0600
    From: [email protected]
    To: [email protected]
    Subject: How can I insert an existing ApDiv into a tab in the Spry Tabbed Panel? 
        Re: How can I insert an existing ApDiv into a tab in the Spry Tabbed Panel? 
        created by Altruistic Gramps in Spry Framework for Ajax - View the full discussion 
    You have really made hard work for yourself by using APDiv's. I suppose it can be done, but I would not. To answer your question, I have create an example as per#apDiv1
    My APDiv
    Content 2
    Tab 1
    Gramps 
         Replies to this message go to everyone subscribed to this thread, not directly to the person who posted the message. To post a reply, either reply to this email or visit the message page: http://forums.adobe.com/message/4498679#4498679
         To unsubscribe from this thread, please visit the message page at http://forums.adobe.com/message/4498679#4498679. In the Actions box on the right, click the Stop Email Notifications link.
         Start a new discussion in Spry Framework for Ajax by email or at Adobe Forums
      For more information about maintaining your forum email notifications please go to http://forums.adobe.com/message/2936746#2936746.

  • How can I search the last line in an internal table?

    How can I search the last line in an internal table?
    With a describe?? If it is , how can I do that?
    Thanks!!

    Hi shilpa,
    it seems to be you are NEW to SDN. welcome. if you want to get solutions to your Questions, you have to post a NEW thread.dont use the existing thread to post your question.
    any way i am giving you the solution for your question
    LOOP AT ITAB WHERE F1 = <SOME VALUE>
                       F2 = <SOME VALUE>.
    ENDLOOP.
    IF SY-SUBRC = 0.
      ITAB WILL HAVE THE LAST RECORD which satisfying the given criteria in WHERE clause of LOOP.
      write itab <--this ITAB will have the last record.
    ENDIF.
    regards,
    Srikanth.
    Message was edited by: Srikanth Kidambi

  • How can I insert a vertical line  between two underlined unfilled with text lines.  I am trying to construct an invoice and I need a break.  If I try any of the shapes or inset functions it eliminates my underlined lines and shifts the whole document.

    I am trying to construct an invoice.  How can I install a vertical line between two or more underlined lines to create a break.  I have tried the insert, shapes and nothing works.  If I try any of the functions the whole document shifts to the right and I loose some of the lines.  Is there a work around, or is I work not able to do what I want?   
    Thanks
    Armand

    It sounds as though you may have "Object Causes Wrap" activated for the Line Shape. This will push other content away.
    See the Wrap Inspector.
    Jerry

  • How can i insert a root certificate into firefox data base

    We are a software development company, we launched an app that is called SAINT, its an internet filters that monitors web traffic, www.saintapp.com, we use a certificate that when going to secure sites, like, hotmail, gmail, aolmail, yahoo mail, banks, etc, it will display an Untrusted connection message and we have to add an exception to continue, that is because firefox uses it own certificate database and does not use microsofts, our app incerts the certificate into microsoftsdata base, how can insert our certificate into Firefox database? or can we sent to you the certificate and you can insert it into your database and release an update? what can we do?
    please advice

    Ok,
    Replace array subset is what I was looking for I think. I'll try it out.
    What I meant earlier is; if you have the array (with row indexing on the left)
    0: 1 1 1 1
    1: 2 2 2 2
    2: 3 3 3 3 
    3: 4 4 4 4
    And you want to put 8888 into array with the insert into array vi, at row 2, it becomes 
    0: 1 1 1 1
    1: 2 2 2 2
    2: 8 8 8 8
    3: 3 3 3 3
    4: 4 4 4 4
    But I want it to look like 
    0: 1 1 1 1
    1: 2 2 2 2
    2: 8 8 8 8
    3: 4 4 4 4 
    So I have overwritten row 2, taking into account array indexing starts at 0 :-)

  • How can I insert a Wordpress page into my Muse site?  I need a client to be able to edit links on specific pages.  Inbrowser doesn't allow client to ad links.

    I need to be able to give my client access to a few pages with links.  These links will change often and they want to make the changes.  What is the best solution if you can insert a Wordpress page into Muse?

    Hi Vickichic,
    It is not possible to insert a wordpress page in Muse. You can refer to this post for a similar discussion : Re: How can i integrate Wordpress in my Muse website?
    Regards,
    Aish

  • How can i insert a heart shape into keynote

    Hi I am new to IMAC and want to insert a heart shape into Keynote so I can colour code it and write text inside - can someone help please -I've tried the drawing tool but no success!! thanks

    "I've tried the draw tool but no success." - Do you mean the tool in the shapes pull-down? It seems to work for me, but I'm not an artist. You might try importing a heart shape you want then use the draw tool to trace around it to get the correct outline you are looking for. When making a shape with the drawing tool, don't forget to place the last edit point over the first and double-click to complete the shape outline. Once drawn, use the graphic tab of the Inspector to assign a fill color. Clicking inside the shape should allow you to add text.
    Good luck.

  • How can i insert  more clob objects into oracle9i?

    my env:
    os: windows server 2003 ent sp2
    php:=5.2.3
    oracle : 9.0.0.8
    i look at this article :
    http://www.oracle.com/technology/pub/articles/oracle_php_cookbook/fuecks_lobs.html
    but ,i want insert two clob into the oracle ....
    Inserting a LOB
    To INSERT an internal LOB, you first need to initialize the LOB using the respective Oracle EMPTY_BLOB or EMPTY_CLOB functions—you cannot update a LOB that contains a NULL value.
    Once initialized, you then bind the column to a PHP OCI-Lob object and update the LOB content via the object's save() method.
    The following script provides an example, returning the LOB type from the INSERT query:
    <?php
    // connect to DB etc...
    $sql = "INSERT INTO
    mylobs
    id,
    mylob
    VALUES
    mylobs_id_seq.NEXTVAL,
    --Initialize as an empty CLOB
    EMPTY_CLOB()
    RETURNING
    --Return the LOB locator
    mylob INTO :mylob_loc";
    $stmt = oci_parse($conn, $sql);
    // Creates an "empty" OCI-Lob object to bind to the locator
    $myLOB = oci_new_descriptor($conn, OCI_D_LOB);
    // Bind the returned Oracle LOB locator to the PHP LOB object
    oci_bind_by_name($stmt, ":mylob_loc", $myLOB, -1, OCI_B_CLOB);
    // Execute the statement using , OCI_DEFAULT - as a transaction
    oci_execute($stmt, OCI_DEFAULT)
    or die ("Unable to execute query\n");
    // Now save a value to the LOB
    if ( !$myLOB->save('INSERT: '.date('H:i:s',time())) ) {
    // On error, rollback the transaction
    oci_rollback($conn);
    } else {
    // On success, commit the transaction
    oci_commit($conn);
    // Free resources
    oci_free_statement($stmt);
    $myLOB->free();
    // disconnect from DB etc.
    ?>

    Use something like:
    sql = "INSERT INTO mylobs (id, mylob1, mylob2) VALUES
    (mylobs_id_seq.NEXTVAL, EMPTY_CLOB(), EMPTY_CLOB()) RETURNING
    mylob1, mylob2 INTO :mylob_loc1, :mylob_loc2";
    You'll need to allocated two lob descriptors and bind both to the statement.
    -- cj

  • How can I insert, modify and delete entries on my table control?

    Hi,
    I already have build a table control. Now I want to make manipulations on it. Therefore I have created 3 buttons, insert, modify and delete. But how can I get actions on table control.
    This is my code for the internal table:
    BEGIN OF its OCCURS 0,
    mark TYPE C VALUE ' ',
    artikel_nr TYPE ZARTIKEL-ARTIKEL_NR,
    artikel_typ TYPE ZARTIKEL-TYPE,
    bezeichnung TYPE ZARTIKEL-BEZEICHNUNG,
    preis TYPE ZARTIKEL-PREIS,
    mwst TYPE ZARTIKEL-MWST,
    END OF its.
    and this is the code which i wanted to  delete a row in my table control:
    WHEN 'DELETE'.
    LOOP AT its WHERE mark EQ 'X'.
    DELETE its WHERE mark = 'X'.
    MOVE its TO ZARTIKEL.
    ENDLOOP.
    ENDCASE.
    ENDMODULE:
    and my PBO and PAI:
    PROCESS BEFORE OUTPUT.
    LOOP AT its INTO ZARTIKEL WITH CONTROL ARTIKEL.
    ENDLOOP.
    PROCESS AFTER INPUT.
    MODULE EXIT.
    LOOP AT its.
    MODULE V1.
    ENDLOOP.
    MODULE user_command_1060.
    But if I now open my table control and mark the line that I wanted to delete, nothing happens, not on my internal table and the data even not deleted on my table ZARTIKEL. Have you an idea what I did wrong??

    Hi,
    In the attributes of table control take the SELCOL as wa_zekpo-flag
    And in the internal table and work area add a field as flag(1) TYPE c
    Refer:
    At screen logic:-
    PROCESS BEFORE OUTPUT.
      MODULE status_8002.
      LOOP WITH CONTROL po_tab.
        MODULE pass_data.
      ENDLOOP.
    PROCESS AFTER INPUT.
      MODULE user_command_8002.
      LOOP WITH CONTROL po_tab.
        MODULE modify_data.
      ENDLOOP.
      MODULE function.
    In PBO,
    MODULE status_8002 OUTPUT.
      SET PF-STATUS 'ZTG_SELTB'.
      DATA : line_count TYPE i.
      DESCRIBE TABLE it_ekpo
      LINES line_count.
      po_tab-lines = line_count + 5.
    ENDMODULE.                 " STATUS_8002  OUTPUT
    *&      Module  PASS_DATA  OUTPUT
    MODULE pass_data OUTPUT.
      READ TABLE it_ekpo into wa_ekpo INDEX po_tab-current_line.
    ENDMODULE.                 " PASS_DATA  OUTPUT
    In PAI,
    *&      Module  USER_COMMAND_8002  INPUT
    MODULE USER_COMMAND_8002 INPUT.
      OK_CODE = SY-UCOMM.
      CASE OK_CODE.
        WHEN 'BACK'.
          LEAVE TO SCREEN 8001.
        WHEN 'EXIT'.
          LEAVE PROGRAM.
      ENDCASE.
    ENDMODULE.                 " USER_COMMAND_8002  INPUT
    *&      Module  MODIFY_DATA  INPUT
    MODULE DISPLAY_DATA INPUT.
      MODIFY IT_EKPO INDEX PO_TAB-CURRENT_LINE FROM WA_EKPO.
    ENDMODULE.                 " MODIFY_DATA  INPUT
    *&      Module  FUNCTION  INPUT
    MODULE FUNCTION INPUT.
      OK_CODE = SY-UCOMM.
      CASE OK_CODE.
        WHEN 'SELECT'. "<--select all records
          LOOP AT IT_EKPO INTO WA_EKPO.
            WA_EKPO-FLAG = 'X'.
            MODIFY IT_EKPO FROM WA_EKPO.
          ENDLOOP.
        WHEN 'DESEL'. "<--deselect all records
          LOOP AT IT_EKPO INTO WA_EKPO.
            WA_EKPO-FLAG = ' '.
            MODIFY IT_EKPO FROM WA_EKPO.
          ENDLOOP.
        WHEN 'DELETE'.
          DELETE FROM it_ekpo WHERE flag = 'X'.
      ENDCASE.
    ENDMODULE.                 " FUNCTION  INPUT
    Regards,
    Tarun

  • Unable to insert more than once into an Oracle table  through ODI

    Hi,
    The scenario is I need to load a table which stores the contact informations (Phones).
    The source data is such that the different types of phones come from different source tables (Home phone, Work Phone, Fax etc)
    I have developed different interfaces in ODI based on the types of phones.
    The issue is for the first time, if I run any of the interfaces it runs properly & the data gets inserted properly. Then if I run any of the other interfaces, it is unable to insert into the intermediate I$ table (I$_Phones) and is stuck there forever :-)
    Is it an ODI issue or an issue with the database? I have manually copied the query and tried to load it into the intermediate table, but it didn't work.
    Have any of you faced this type of issues in ODI ever? If so, are there any work arounds?
    PS - I have checked whether I am dropping the intermediate flow tables after inserting the records.

    Thanks Ankit,
    I was using IKM Oracle Incremental Update. The volume of data is around 300,000.
    It didn't fail, It just took forever. It got stuck in the step "Insert flow in I$ table". (FYI, I have disabled the Flow control in the IKM).
    Almost the same query ran properly and got the data loaded when its used in the initial interface. I have pasted the query below.
    /* DETECTION_STRATEGY = NOT_EXISTS */
    insert /*+ APPEND */ into PROD_ODI_WORK.I$_PHONES
         SRC_CLIENT_ID,
         PHONE_NO,
         PHONE_TYPE_ID,
         IND_UPDATE
    select      
         C1_SRC_CLIENT_ID     SRC_CLIENT_ID,
         C2_PHONE_NO     PHONE_NO,
         1     PHONE_TYPE_ID,
         'I' IND_UPDATE
    from     PROD_ODI_WORK.C$_0PHONES
    where     (1=1)
    and not exists (
         select     'X'
         from     CIF_STG.PHONES T
         where     T.SRC_CLIENT_ID     = C1_SRC_CLIENT_ID
         and     T.SRC_SYSTEM_ID     = 'BARS'
              and     ((C2_PHONE_NO = T.PHONE_NO) or (C2_PHONE_NO IS NULL and T.PHONE_NO IS NULL))
              and     ((1 = T.PHONE_TYPE_ID) or (1 IS NULL and T.PHONE_TYPE_ID IS NULL))
         )

  • How can i Insert a blank line an output file from my code

    I hav a problem in printing the charecters at th partyicular positon by getting the getFilePointer SO p-lz do help

    It's not so simple as you might have in mind.
    The following may serve to give some idea for your purpose..
    import java.io.*;
    public class RandAcc {
    public static void main(String[] args) throws Exception{
    try{
    long filePointer=0L;
    java.io.RandomAccessFile rf = new java.io.RandomAccessFile("in.txt","rw");//arbitrary input text file
    System.out.println(String.valueOf(rf.getFilePointer()));
    int q=0;
    while((q=rf.read())!=-1){
        filePointer=rf.getFilePointer();
        System.out.print(String.valueOf(q)); 
        System.out.print(": file pointer is at ");     
        System.out.println(String.valueOf(filePointer));
    rf.seek(0L);//reset the filepointer
    System.out.println(String.valueOf((char)rf.read()));//initial position
    rf.close();    
    catch (Exception e){
        throw e;
    }

  • How can I insert a widget slideshow into a template-based page in Dreamweaver

    HI, I Have a question that has been nagging me for the last three hours.
    I have been trying to insert a slideshow into a template based document using the insert widget function in Dreamweaver CS 5.5.  The problem is that I contine to get the error that
        "This widget requires code that must be inserted into the head of the current document.  Insertion cannot happen because the head of this document is read only."
    I have tried to edit the template file in order to make the head tag into an editable region.  I have tried to resolve the problem by eliminating the
    <!-- #BeginEditable "doctitle" --> function call and instead using the <!-- InstanceBeginEditable name="head" -->
    function, but all that does is grey out all the code on the page following the this function call.  The other side effect of using this method is that the child documents do not even have a header anymore.
    I do not know if this is just a lack of understanding how this works, or if there is a bug in Dreamweaver.
    Any help in this subject wold be appreciated. 
    The original HTML for the template in question is below.
    Header 1
    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN">
    <html>
    <head>
    <!-- #BeginEditable "doctitle" -->
    <title>Priental Solar, Solar, Photovoltaik, PV Anlagen</title>
    <!-- #EndEditable -->
    <META NAME="Title" CONTENT="Priental Solar, Solar, Photovoltaik, PV Anlagen</">
    <META NAME="Author" CONTENT="Priental Solar, Solar, Photovoltaik, PV Anlagen">
    <META NAME="Publisher" CONTENT="Priental Solar, Solar, Photovoltaik, PV Anlagen">
    <META NAME="Copyright" CONTENT="printEFFECTS  GbR 2011">
    <META NAME="Revisit" CONTENT="After 14 days">
    <META NAME="Keywords" CONTENT="Sonnenenergie, Solar, Photovoltaik, Photovoltaik energie, solarmodul, solarmodule, solaranlagen, solarenergie, solaranlage, pv anlage, erneuerbare energie, pv anlagen, solarenergie photovoltaik">
    <meta name="abstract" content="Sonnenenergie, Solar, Photovoltaik, Photovoltaik energie, solarmodul, solarmodule, solaranlagen, solarenergie, solaranlage, pv anlage, erneuerbare energie, pv anlagen, solarenergie photovoltaik">
    <META NAME="Description" CONTENT="Hier können Sie kostenlos ein Angebot für eine PV Anlage (Photovoltaikanlage) anfordern. Priental Solar ist Ihr Partner für Planung und Installation von Photovoltaikanlagen">
    <META NAME="Abstract" CONTENT="Priental Energiesysteme & Priental Solar, Solar, Photovoltaik, PV Anlagen</">
    <meta name="classification" content="Priental Energiesysteme & Priental Solar, Solar, Photovoltaik, PV Anlagen">
    <META NAME="audience" CONTENT=" Alle ">
    <META NAME="Robots" CONTENT="INDEX,FOLLOW">
    <META NAME="Language" CONTENT="Deutsch">
    <META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=iso-8859-1">
    <link rel="stylesheet" href="../style.css" type="text/css">
    <link rel="shortcut icon" href="favicon.ico" type="image/x-icon">
    </head>
    <body leftmargin="0" topmargin="0" marginwidth="0" marginheight="0">
    <div class="back">
      <table width="100%" border="0" cellspacing="0" cellpadding="0">
        <tr>
          <td height="100%" align="center">
            <table width="900" border="0" cellspacing="0" cellpadding="0" height="10">
              <tr>
                <td height="10"></td>
              </tr>
            </table>
            <table width="900" border="0" cellspacing="0" cellpadding="0" height="142">
              <tr>
                <td>
                  <table width="900" border="0" cellspacing="0" cellpadding="0" height="142">
                    <tr>
                      <td width="645"><a href="../index.html"><img src="../images/top-1-2_01.jpg" width="645" height="142" border="0"></a></td>
                      <td width="255" background="../images/top-1-2_02.jpg"> </td>
                    </tr>
                  </table>
                </td>
              </tr>
            </table>
            <table width="900" border="0" cellspacing="0" cellpadding="5" height="20" bgcolor="#CCCCCC">
              <tr>
                <td bgcolor="#003366">
                  <div align="right">   <a href="../kont_schreiben.php" class="linkGrey">Kontakt</a>     <span class="linkGrey">|</span>     <a href="../anfahrt.htm" class="linkGrey">Anfahrt</a>    <span class="linkGrey">|</span>     <a href="../Impressum.htm" class="linkGrey">Impressum</a>    </div>
                </td>
              </tr>
            </table>
            <table width="900" border="0" cellspacing="0" cellpadding="5" height="3" bgcolor="#99CC33">
              <tr>
                <td bgcolor="#99CC33"> </td>
              </tr>
            </table>
            <table width="900" border="0" cellspacing="0" cellpadding="0" height="450">
              <tr>
                <td valign="top">
                  <table width="900" border="0" cellspacing="0" cellpadding="3">
                    <tr>
                      <td valign="top" width="180" bgcolor="#99CCCC">
                        <table width="180" border="0" cellpadding="10">
                          <tr>
                            <td bgcolor="99CC33">
                              <div align="left"><a href="../index.html" class="linkmmenu2">Startseite</a></div>
                            </td>
                          </tr>
                          <tr>
                            <td bgcolor="99CC33">
                              <div align="left"><a href="../Solaranlagen.htm" class="linkmmenu2">Solaranlagen</a></div>
                            </td>
                          </tr>
                          <tr>
                            <td bgcolor="99CC33">
                              <div align="left"><a href="../BHKW.htm" class="linkmmenu2">BHKW</a></div>
                            </td>
                          </tr>
                          <tr>
                            <td bgcolor="99CC33">
                              <div align="left"><a href="../heimkraftwerk.htm" class="linkGrey"><span class="linkmmenu2">Priental Heimkraftwerk</span></a></div>
                            </td>
                          </tr>
                           <tr>
                            <td bgcolor="99CC33">
                              <div align="left"><a href="../FAQ.html" class="linkGrey"><span class="linkmmenu2">Heimkraftwerk FAQ</span></a></div>
                            </td>
                          </tr>
                          <tr>
                            <td bgcolor="99CC33">
                              <div align="left"><a href="../Brandsicherung.htm" class="linkmmenu2">Brandsicherung</a></div>
                            </td>
                          </tr>
                          <tr>
                            <td bgcolor="99CC33">
                              <div align="left"><a href="../Solar-Lexikon.htm" class="linkmmenu2">Solarlexikon</a></div>
                            </td>
                          </tr>
                          <tr>
                            <td bgcolor="99CC33">
                              <div align="left"><a href="../Team.htm" class="linkmmenu2">&Uuml;ber
                                uns / Team</a></div>
                            </td>
                          </tr>
                          <tr>
                            <td bgcolor="99CC33">
                              <div align="left"><a href="../1_Referenzen4_70KwP.htm" class="linkmmenu2">Referenzen</a></div>
                            </td>
                          </tr>
                          <tr>
                            <td bgcolor="99CC33">
                              <div align="left"><a href="../newsletter_anm.php" class="linkmmenu2">Anmeldung News</a></div>
                            </td>
                          </tr>
                          <tr>
                            <td bgcolor="99CC33">
                              <div align="left"><a href="../pdf/empfehlung_heimkraftwerk.pdf" target="_new" class="linkmmenu2">Empfehlungen</a></div>
                            </td>
                          </tr>
                        </table>
                      </td>
                      <td width="20" bgcolor="#99CCCC"> </td>
                      <td valign="top" width="660" align="left" bgcolor="#FFFFFF">
                        <table width="660" border="0" cellspacing="8" cellpadding="0" height="450" bordercolor="#999933" bgcolor="#F0F8FB" align="left">
                          <tr>
                            <td align="left"><!-- #BeginEditable "content" -->{content}<!-- #EndEditable --></td>
                          </tr>
                        </table>
                      </td>
                    </tr>
                  </table>
                </td>
              </tr>
            </table>
            <table width="900" border="0" cellspacing="0" cellpadding="5" height="25" bgcolor="#003366">
              <tr>
                <td height="10" align="left">     <span class="txtBottomSm">BERATUNG
                  | PLANUNG | KOMPLETTSERVICE</span></td>
              </tr>
            </table>
            <table width="900" border="0" cellspacing="0" cellpadding="0" height="60" bgcolor="99CC33">
              <tr>
                <td height="10">
                  <table width="860" border="0" cellspacing="0" cellpadding="20">
                    <tr>
                      <td align="left"><!-- #BeginEditable "bottom" -->{bottom}<!-- #EndEditable --></td>
                    </tr>
                  </table>
                </td>
              </tr>
            </table>
          </td>
        </tr>
      </table>
    </div>
    </body>
    </html>

    Thanks for the response.
    Unfortunately, I have tried it, but continue to recieve the same error message.  I have double checked the syntax and positioning of the editable regions, and they match yours completely.  In the child page everything is editable.  Do you have any other suggestions for this perplexing problem?  Thanks
    Here is the syntax of the header tag from the child page showing all of the editable regions:
    Header 1
    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN">
    <html><!-- #BeginTemplate "/Templates/comp.dwt" --><!-- DW6 -->
    <head>
    <!-- #BeginEditable "doctitle" -->
    <title>Priental Solar, Solar, Photovoltaik, PV Anlagen</title>
    <!-- #EndEditable -->
    <!-- #BeginEditable "meta" -->
    <META NAME="Title" CONTENT="Priental Solar, Solar, Photovoltaik, PV Anlagen</">
    <META NAME="Author" CONTENT="Priental Solar, Solar, Photovoltaik, PV Anlagen">
    <META NAME="Publisher" CONTENT="Priental Solar, Solar, Photovoltaik, PV Anlagen">
    <META NAME="Copyright" CONTENT="printEFFECTS  GbR 2011">
    <META NAME="Revisit" CONTENT="After 14 days">
    <META NAME="Keywords" CONTENT="Sonnenenergie, Solar, Photovoltaik, Photovoltaik energie, solarmodul, solarmodule, solaranlagen, solarenergie, solaranlage, pv anlage, erneuerbare energie, pv anlagen, solarenergie photovoltaik">
    <meta name="abstract" content="Sonnenenergie, Solar, Photovoltaik, Photovoltaik energie, solarmodul, solarmodule, solaranlagen, solarenergie, solaranlage, pv anlage, erneuerbare energie, pv anlagen, solarenergie photovoltaik">
    <META NAME="Description" CONTENT="Hier können Sie kostenlos ein Angebot für eine PV Anlage (Photovoltaikanlage) anfordern. Priental Solar ist Ihr Partner für Planung und Installation von Photovoltaikanlagen">
    <META NAME="Abstract" CONTENT="Priental Energiesysteme & Priental Solar, Solar, Photovoltaik, PV Anlagen</">
    <meta name="classification" content="Priental Energiesysteme & Priental Solar, Solar, Photovoltaik, PV Anlagen">
    <META NAME="audience" CONTENT=" Alle ">
    <META NAME="Robots" CONTENT="INDEX,FOLLOW">
    <META NAME="Language" CONTENT="Deutsch">
    <META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=iso-8859-1">
    <!-- #EndEditable -->
    <!-- #BeginEditable "head" -->
    <link rel="stylesheet" href="style.css" type="text/css">
    <link rel="shortcut icon" href="favicon.ico" type="image/x-icon">
    <!-- #EndEditable -->
    </head>

  • How can I insert an image(JPG) into a SQL database?

    I have written an application to perform some tests in the lab.  After gathering the data I store it into a SQL Server.  I successfully managed to export all my raw numbers and calculations to the DB.  However I have not been able to export a screenshot of the Front panel.  I can write the screenshot to a JPG file just fine.  The problem is putting the image (binary data) into the DB.
    So from what work I've managed to do, two questions come to mind:
    1)  Is there a way to compress the screenshot, using standard JPG compression, without actually writing out to a file.  ie:  Just have a binary stream of the compressed image that I can write to the SQL database.
    2)  Even if I don't use compression, I can't write any kind of data that appears as an image.  What kind of data do I need to be writing from LabView to store it properly in an 'image' or 'binary' type field in a SQL database?  I am not looking for answer "binary data."  Nor do I want the answer that is stated in the Help file for the DB Connectivity Toolkit(type - Data Cluster).  What I need is to know what kind of conversions I need to do on the image data that comes out of the FP.GetScaledImage.
    I am using LabView 8.0 and have the Database connectivity toolkit.  We are running SQL Server 2000 and 2005.

    I also hit this limit.  In the end I just wrote the JPGs to disk, and stored the file path in the DB.  Not the ideal solution, I know.
    I'm trying to remember now, exactly what the problem was.  You're right to say the image data type should handle up to 2GB.  I think in the end, it was an issue of the LabView toolkit not playing well with newer versions of SQL Server, which have the image type.  Re-reading the error though, it sounds like it might be an issue with the ODBC driver.  FYI, 8KB used to be the max size for the largest types in SQL Server (I think binary in 2000).  I suspect this limit was coded into the driver or LabView, and can't handle the newer, larger types.
    That being said, the LabView DB toolkit was either written poorly or written a long time ago.  It has issues with generating SQL queries that have the proper quotes.  For example, if your column names have spaces in them, the toolkit will be unable to generate a valid query, without some modification of the toolkit *.vi's.  Images in a database is not a new concept and not new to me.  I've never used a language where it was more complicated or difficult to get working.  Unless you absolutely have to, I'd work out a way to just store the JPGs to disk, with the path in the DB.  Spending too much time on this defeats the purpose of using LabView.
    If NI decides to update the DB toolkit, then it might be worth giving it a try again.
    In case any NI people are reading this, this is a not so subtle hint that you need to update the DB toolkit to support modern DB features.  Especially, if NI is charging $1000 for it.

  • Can't insert schema-based xmltype into binary xmltype table

    I'm having issues trying to use binary storage along with the ALLOW ANYSCHEMA clause. I can't use the XMLSchema-instance mechanism for creating my schema-based XMLType instances, so I'm using CreateSchemaBasedXml. When I try to insert the XMLType into the table, however, it seems to think it's not schema-based and throws an error. I trimmed down my schema for the purposes of this example. Here's the schema (schematest.xsd):
    <?xml version="1.0" encoding="Windows-1252"?>
    <xs:schema attributeFormDefault="unqualified" elementFormDefault="qualified" xmlns:xs="http://www.w3.org/2001/XMLSchema">
      <xs:element name="FORMINFO">
        <xs:complexType>
          <xs:sequence>
            <xs:element name="SUBJECT">
              <xs:complexType>
                <xs:sequence>
                  <xs:element name="ADDR">
                    <xs:complexType>
                      <xs:sequence>
                        <xs:element name="STREET" type="xs:string" />
                        <xs:element name="CITY" type="xs:string" />
                        <xs:element name="STATEPROV" type="xs:string" />
                        <xs:element name="ZIP" type="xs:string" />
                      </xs:sequence>
                    </xs:complexType>
                  </xs:element>
                </xs:sequence>
              </xs:complexType>
            </xs:element>
          </xs:sequence>
        </xs:complexType>
      </xs:element>
    </xs:schema>Here's the instance file (schema testinst.xml):
    <?xml version="1.0" encoding="utf-8"?>
    <FORMINFO>
       <SUBJECT>
          <ADDR>
             <STREET>123 Main St</STREET>
             <CITY>Las Vegas</CITY>
             <STATEPROV>NV</STATEPROV>
             <ZIP>12345</ZIP>
          </ADDR>
       </SUBJECT>
    </FORMINFO>I registered the schema and created the test table:
    BEGIN
      DBMS_XMLSCHEMA.registerschema(
       schemaurl => 'http://localhost/schematest.xsd',
       schemadoc => bfilename('XMLDIR','schematest.xsd'),
       gentables => false,
       gentypes => false,
       csid => nls_charset_id('AL32UTF8'),
       options => DBMS_XMLSCHEMA.REGISTER_BINARYXML);
    END;
    CREATE TABLE BINARYTEST OF XMLType
    XMLTYPE STORE AS BINARY XML
    ALLOW ANYSCHEMA;But trying to insert gives me an ORA-44422 error (this is on Oracle 11.1.0.7.0 Enterprise):
    SQL> SET SERVEROUTPUT ON
    SQL> declare
      2    x XMLType;
      3    xschema XMLType;
      4  begin
      5    x := XMLType(bfilename('XMLDIR', 'schematestinst.xml'), nls_charset_id('AL32UTF8'));
      6    xschema := x.CreateSchemaBasedXml('http://localhost/schematest.xsd');
      7    xschema.SchemaValidate();
      8    DBMS_OUTPUT.PUT_LINE('Schema: ' || xschema.GetSchemaURL() || ' Validated: ' || xschema.IsSchemaValidated());
      9
    10    INSERT INTO BINARYTEST
    11    VALUES (xschema);
    12    commit;
    13  end;
    14  /
    Schema: http://localhost/schematest.xsd Validated: 1
    declare
    ERROR at line 1:
    ORA-44422: nonschema XML disallowed for this column
    ORA-06512: at line 10You can see from my put_line statement that the XMLType object is reporting its schema URL correctly and thinks it's been validated. Changing the table to "ALLOW NONSCHEMA" allows the insert, but it inserts it as a non-schema-based document. Am I skipping a step here?
    Thanks,
    Jim

    It might be a bug, but I am not yet sure...
    See the following examples...
    c:\>C:\oracle\product\11.1.0\db_1\bin\sqlplus.exe /nolog
    SQL*Plus: Release 11.1.0.7.0 - Production on Mon Mar 23 22:14:41 2009
    Copyright (c) 1982, 2008, Oracle.  All rights reserved.
    SQL> drop user otn cascade;
    User dropped.
    SQL> create user otn identified by otn;
    User created.
    SQL> grant xdbadmin, dba to otn;
    Grant succeeded.
    SQL> conn otn/otn
    connected.
    SQL> var schemaPath varchar2(256)
    SQL> var schemaURL  varchar2(256)
    SQL>
    SQL> begin
      2    :schemaURL := 'http://localhost/schematest.xsd';
      3    :schemaPath := '/public/schematest.xsd';
      4  end;
      5  /
    PL/SQL procedure successfully completed.
    SQL>
    SQL> declare
      2    res boolean;
      3    xmlSchema xmlType := xmlType('<?xml version="1.0" encoding="Windows-1252"?>
      4  <xs:schema attributeFormDefault="unqualified" elementFormDefault="qualified" xmlns:xs="http://www.w3.org/2001/XMLSchema">
      5    <xs:element name="FORMINFO">
      6      <xs:complexType>
      7        <xs:sequence>
      8          <xs:element name="SUBJECT">
      9            <xs:complexType>
    10              <xs:sequence>
    11                <xs:element name="ADDR">
    12                  <xs:complexType>
    13                    <xs:sequence>
    14                      <xs:element name="STREET" type="xs:string" />
    15                      <xs:element name="CITY" type="xs:string" />
    16                      <xs:element name="STATEPROV" type="xs:string" />
    17                      <xs:element name="ZIP" type="xs:string" />
    18                    </xs:sequence>
    19                  </xs:complexType>
    20                </xs:element>
    21              </xs:sequence>
    22            </xs:complexType>
    23          </xs:element>
    24        </xs:sequence>
    25      </xs:complexType>
    26    </xs:element>
    27  </xs:schema>');
    28  begin
    29  if (dbms_xdb.existsResource(:schemaPath)) then
    30      dbms_xdb.deleteResource(:schemaPath);
    31  end if;
    32   res := dbms_xdb.createResource(:schemaPath,xmlSchema);
    33  end;
    34  /
    PL/SQL procedure successfully completed.
    SQL> commit;
    Commit complete.
    SQL> call dbms_xmlschema.deleteSchema(:schemaURL,4);
    Call completed.
    SQL> BEGIN
      2   DBMS_XMLSCHEMA.registerSchema(
      3    SCHEMAURL => :SchemaURL,
      4    SCHEMADOC => xdbURIType(:SchemaPath).getClob(),
      5    LOCAL     => FALSE, -- local
      6    GENTYPES  => FALSE, -- generate object types
      7    GENBEAN   => FALSE, -- no java beans
      8    GENTABLES => FALSE, -- generate object tables
      9    OPTIONS   => DBMS_XMLSCHEMA.REGISTER_BINARYXML,
    10    OWNER     => USER
    11   );
    12  END;
    13  /
    PL/SQL procedure successfully completed.
    SQL> commit;
    Commit complete.
    SQL> var schemaDoc  varchar2(256)
    SQL>
    SQL> begin
      2    :schemaDoc := '/public/schematest.xml';
      3  end;
      4  /
    PL/SQL procedure successfully completed.
    SQL>
    SQL> ----------------------------------------------------------
    SQL>
    SQL> -- Create an XML Document in the repository
    SQL>
    SQL> ----------------------------------------------------------
    SQL>
    SQL> declare
      2    res boolean;
      3    xmlDoc xmlType := xmlType('<?xml version="1.0" encoding="utf-8"?>
      4  <FORMINFO>
      5     <SUBJECT>
      6        <ADDR>
      7           <STREET>123 Main St</STREET>
      8           <CITY>Las Vegas</CITY>
      9           <STATEPROV>NV</STATEPROV>
    10           <ZIP>12345</ZIP>
    11        </ADDR>
    12     </SUBJECT>
    13  </FORMINFO>');
    14  begin
    15  if (dbms_xdb.existsResource(:schemaDoc)) then
    16      dbms_xdb.deleteResource(:schemaDoc);
    17  end if;
    18   res := dbms_xdb.createResource(:schemaDoc,xmlDoc);
    19  end;
    20  /
    PL/SQL procedure successfully completed.
    SQL>
    SQL> ----------------------------------------------------------
    SQL>
    SQL> -- Ready to test
    SQL>
    SQL> ----------------------------------------------------------
    SQL>
    SQL> select * from tab;
    no rows selected
    SQL> CREATE TABLE BINARYTEST OF XMLType
      2  XMLTYPE STORE AS BINARY XML
      3  ALLOW ANYSCHEMA;
    Table created.
    SQL> set long 100000
    SQL> select dbms_metadata.get_ddl('TABLE','BINARYTEST',user) from dual;
    DBMS_METADATA.GET_DDL('TABLE','BINARYTEST',USER)
      CREATE TABLE "OTN"."BINARYTEST" OF "SYS"."XMLTYPE"
    OIDINDEX  ( PCTFREE 10 INITRANS 2 MAXTRANS 255
      STORAGE(INITIAL 65536 NEXT 1048576 MINEXTENTS 1 MAXEXTENTS 2147483645
      PCTINCREASE 0 FREELISTS 1 FREELIST GROUPS1 BUFFER_POOL DEFAULT)
      TABLESPACE "USERS" )
    PCTFREE 10 PCTUSED 40 INITRANS 1 MAXTRANS 255 NOCOMPRESS LOGGING
      STORAGE(INITIAL 65536 NEXT 1048576 MINEXTENTS 1 MAXEXTENTS 2147483645
      PCTINCREASE 0 FREELISTS 1 FREELIST GROUPS 1 BUFFER_POOL DEFAULT)
      TABLESPACE "USERS"
    XMLTYPE COLUMN OBJECT_VALUE STORE AS BASICFILE BINARY XML (
      TABLESPACE "USERS" ENABLE STORAGE IN ROW CHUNK 8192 PCTVERSION 10
      NOCACHE LOGGING
      STORAGE(INITIAL 65536 NEXT 1048576 MINEXTENTS 1 MAXEXTENTS 2147483645
      PCTINCREASE 0 FREELISTS 1 FREELIST GROUPS 1
    BUFFER_POOL DEFAULT))
    DISALLOW NONSCHEMA
    ALLOW ANYSCHEMA
    1 row selected.
    SQL> SET SERVEROUTPUT ON
    SQL> declare
      2    x XMLType;
      3    xschema XMLType;
      4  begin
      5    x := XMLType(xdbUriType(:SchemaDoc).getClob());
      6    xschema := x.CreateSchemaBasedXml('http://localhost/schematest.xsd');
      7    xschema.SchemaValidate();
      8    DBMS_OUTPUT.PUT_LINE('Schema: ' || xschema.GetSchemaURL() || ' Validated: ' || xschema.IsSchemaValidated());
      9
    10    INSERT INTO BINARYTEST
    11    VALUES (xschema);
    12    commit;
    13  end;
    14  /
    Schema: http://localhost/schematest.xsd Validated: 1
    declare
    ERROR at line 1:
    ORA-44422: nonschema XML disallowed for this column
    ORA-06512: at line 10
    -- ORA-44421: cannot DISALLOW NONSCHEMA without a SCHEMA clause
    -- Cause: If no SCHEMA clause (explicit schema or ANYSCHEMA) was specified, nonschema data cannot be disallowed.-
    -- Action: Remove DISALLOW NONSCHEMA or add some SCHEMA clause.
    SQL> drop table binarytest;
    Table dropped.
    SQL> CREATE TABLE BINARYTEST OF XMLType
      2  XMLTYPE STORE AS BINARY XML
      3  ALLOW NONSCHEMA;
    Table created.
    SQL> select dbms_metadata.get_ddl('TABLE','BINARYTEST',user) from dual;
    DBMS_METADATA.GET_DDL('TABLE','BINARYTEST',USER)
      CREATE TABLE "OTN"."BINARYTEST" OF "SYS"."XMLTYPE"
    OIDINDEX  ( PCTFREE 10 INITRANS 2 MAXTRANS 255
      STORAGE(INITIAL 65536 NEXT 1048576 MINEXTENTS 1 MAXEXTENTS 2147483645
      PCTINCREASE 0 FREELISTS 1 FREELIST GROUPS1 BUFFER_POOL DEFAULT)
      TABLESPACE "USERS" )
    PCTFREE 10 PCTUSED 40 INITRANS 1 MAXTRANS 255 NOCOMPRESS LOGGING
      STORAGE(INITIAL 65536 NEXT 1048576 MINEXTENTS 1 MAXEXTENTS 2147483645
      PCTINCREASE 0 FREELISTS 1 FREELIST GROUPS 1 BUFFER_POOL DEFAULT)
      TABLESPACE "USERS"
    XMLTYPE COLUMN OBJECT_VALUE STORE AS BASICFILE BINARY XML (
      TABLESPACE "USERS" ENABLE STORAGE IN ROW CHUNK 8192 PCTVERSION 10
      NOCACHE LOGGING
      STORAGE(INITIAL 65536 NEXT 1048576 MINEXTENTS 1 MAXEXTENTS 2147483645
      PCTINCREASE 0 FREELISTS 1 FREELIST GROUPS 1
    BUFFER_POOL DEFAULT))
    ALLOW NONSCHEMA
    DISALLOW ANYSCHEMA
    1 row selected.
    SQL> declare
      2    x XMLType;
      3    xschema XMLType;
      4  begin
      5    x := XMLType(xdbUriType(:SchemaDoc).getClob());
      6    xschema := x.CreateSchemaBasedXml('http://localhost/schematest.xsd');
      7    xschema.SchemaValidate();
      8    DBMS_OUTPUT.PUT_LINE('Schema: ' || xschema.GetSchemaURL() || ' Validated: ' || xschema.IsSchemaValidated());
      9
    10    INSERT INTO BINARYTEST
    11    VALUES (xschema);
    12    commit;
    13  end;
    14  /
    Schema: http://localhost/schematest.xsd Validated: 1
    PL/SQL procedure successfully completed.
    SQL> select * from binarytest;
    SYS_NC_ROWINFO$
    <?xml version="1.0" encoding="UTF-8"?>
    <FORMINFO>
      <SUBJECT>
        <ADDR>
          <STREET>123 Main St</STREET>
          <CITY>Las Vegas</CITY>
          <STATEPROV>NV</STATEPROV>
          <ZIP>12345</ZIP>
        </ADDR>
      </SUBJECT>
    </FORMINFO>
    1 row selected.
    SQL> SET SERVEROUTPUT ON
    SQL> declare
      2    x XMLType;
      3    xschema XMLType;
      4  begin
      5    x := XMLType(xdbUriType(:SchemaDoc).getClob());
      6
      7    dbms_output.put_line(x.getstringval());
      8
      9    xschema := x.CreateSchemaBasedXml('http://localhost/schematest.xsd');
    10
    11    dbms_output.put_line(xschema.getstringval());
    12
    13    xschema.SchemaValidate();
    14    DBMS_OUTPUT.PUT_LINE('Schema: ' || xschema.GetSchemaURL() || ' Validated: ' || xschema.IsSchemaValidated());
    15
    16    INSERT INTO BINARYTEST
    17    VALUES (xschema);
    18    commit;
    19  end;
    20  /
    <?xml version="1.0" encoding="UTF-8"?>
    <FORMINFO>
      <SUBJECT>
        <ADDR>
          <STREET>123 Main St</STREET>
          <CITY>Las
    Vegas</CITY>
          <STATEPROV>NV</STATEPROV>
          <ZIP>12345</ZIP>
        </ADDR>
      </SUBJECT>
    </FORMINFO>
    <?xml version="1.0" encoding="UTF-8"?>
    <FORMINFO>
      <SUBJECT>
        <ADDR>
          <STREET>123 Main St</STREET>
          <CITY>Las
    Vegas</CITY>
          <STATEPROV>NV</STATEPROV>
          <ZIP>12345</ZIP>
        </ADDR>
      </SUBJECT>
    </FORMINFO>
    Schema: http://localhost/schematest.xsd Validated: 1
    PL/SQL procedure successfully completed.
    SQL> create table ORtest of xmltype
      2  xmlschema "http://localhost/schematest.xsd" element "FORMINFO"
      3  ;
    Table created.
    SQL> declare
      2    x XMLType;
      3    xschema XMLType;
      4  begin
      5    x := XMLType(xdbUriType(:SchemaDoc).getClob());
      6
      7    dbms_output.put_line(x.getstringval());
      8
      9    xschema := x.CreateSchemaBasedXml('http://localhost/schematest.xsd');
    10
    11    dbms_output.put_line(xschema.getstringval());
    12
    13    xschema.SchemaValidate();
    14    DBMS_OUTPUT.PUT_LINE('Schema: ' || xschema.GetSchemaURL() || ' Validated: ' || xschema.IsSchemaValid());
    15
    16    INSERT INTO ORTEST
    17    VALUES (xschema);
    18    commit;
    19  end;
    20  /
    <?xml version="1.0" encoding="UTF-8"?>
    <FORMINFO>
      <SUBJECT>
        <ADDR>
          <STREET>123 Main St</STREET>
          <CITY>Las
    Vegas</CITY>
          <STATEPROV>NV</STATEPROV>
          <ZIP>12345</ZIP>
        </ADDR>
      </SUBJECT>
    </FORMINFO>
    <?xml version="1.0" encoding="UTF-8"?>
    <FORMINFO>
      <SUBJECT>
        <ADDR>
          <STREET>123 Main St</STREET>
          <CITY>Las
    Vegas</CITY>
          <STATEPROV>NV</STATEPROV>
          <ZIP>12345</ZIP>
        </ADDR>
      </SUBJECT>
    </FORMINFO>
    Schema: http://localhost/schematest.xsd Validated: 1
    PL/SQL procedure successfully completed.
    SQL> declare
      2    x XMLType;
      3    xschema XMLType;
      4  begin
      5    x := XMLType(xdbUriType(:SchemaDoc).getClob());
      6
      7    dbms_output.put_line(x.getstringval());
      8
      9    xschema := x.CreateSchemaBasedXml('http://localhost/schematest.xsd');
    10
    11    dbms_output.put_line(xschema.getstringval());
    12
    13    xschema.SchemaValidate();
    14    DBMS_OUTPUT.PUT_LINE('Schema: ' || xschema.GetSchemaURL() || ' Validated: ' || xschema.IsSchemaValid());
    15
    16    INSERT INTO BIN_ONE_SCHEMA
    17    VALUES (xschema);
    18    commit;
    19  end;
    20  /
    <?xml version="1.0" encoding="UTF-8"?>
    <FORMINFO>
      <SUBJECT>
        <ADDR>
          <STREET>123 Main St</STREET>
          <CITY>Las
    Vegas</CITY>
          <STATEPROV>NV</STATEPROV>
          <ZIP>12345</ZIP>
        </ADDR>
      </SUBJECT>
    </FORMINFO>
    <?xml version="1.0" encoding="UTF-8"?>
    <FORMINFO>
      <SUBJECT>
        <ADDR>
          <STREET>123 Main St</STREET>
          <CITY>Las
    Vegas</CITY>
          <STATEPROV>NV</STATEPROV>
          <ZIP>12345</ZIP>
        </ADDR>
      </SUBJECT>
    </FORMINFO>
    Schema: http://localhost/schematest.xsd Validated: 1
    PL/SQL procedure successfully completed.
    SQL> ----------------------------------------------------------
    SQL>
    SQL> -- Create an XML Document in the repository
    SQL>
    SQL> ----------------------------------------------------------
    SQL>
    SQL> declare
      2    res boolean;
      3    xmlDoc xmlType := xmlType('<?xml version="1.0" encoding="utf-8"?>
      4  <FORMINFO>
      5     <SUBJECT>
      6        <ADDR>
      7           <STREET>123 Main St</STREET>
      8           <CITY>Las Vegas</CITY>
      9           <STATEPROV>NV</STATEPROV>
    10           <ZIP>12345</ZIP>
    11           <ONE_TO_MANY>say what?</ONE_TO_MANY>
    12        </ADDR>
    13     </SUBJECT>
    14  </FORMINFO>');
    15  begin
    16  if (dbms_xdb.existsResource(:schemaDoc)) then
    17      dbms_xdb.deleteResource(:schemaDoc);
    18  end if;
    19   res := dbms_xdb.createResource(:schemaDoc,xmlDoc);
    20  end;
    21  /
    PL/SQL procedure successfully completed.
    SQL> declare
      2    x XMLType;
      3    xschema XMLType;
      4  begin
      5    x := XMLType(xdbUriType(:SchemaDoc).getClob());
      6
      7    dbms_output.put_line(x.getstringval());
      8
      9    xschema := x.CreateSchemaBasedXml('http://localhost/schematest.xsd');
    10
    11    dbms_output.put_line(xschema.getstringval());
    12
    13    xschema.SchemaValidate();
    14    DBMS_OUTPUT.PUT_LINE('Schema: ' || xschema.GetSchemaURL() || ' Validated: ' || xschema.IsSchemaValid());
    15
    16    INSERT INTO BIN_ONE_SCHEMA
    17    VALUES (xschema);
    18    commit;
    19  end;
    20  /
    <?xml version="1.0" encoding="UTF-8"?>
    <FORMINFO>
      <SUBJECT>
        <ADDR>
          <STREET>123 Main St</STREET>
          <CITY>Las
    Vegas</CITY>
          <STATEPROV>NV</STATEPROV>
          <ZIP>12345</ZIP>
          <ONE_TO_MANY>say what?</ONE_TO_MANY>
        </ADDR>
    </SUBJECT>
    </FORMINFO>
    <?xml version="1.0" encoding="UTF-8"?>
    <FORMINFO>
      <SUBJECT>
        <ADDR>
          <STREET>123 Main St</STREET>
          <CITY>Las
    Vegas</CITY>
          <STATEPROV>NV</STATEPROV>
          <ZIP>12345</ZIP>
          <ONE_TO_MANY>say what?</ONE_TO_MANY>
        </ADDR>
    </SUBJECT>
    </FORMINFO>
    declare
    ERROR at line 1:
    ORA-31154: invalid XML document
    ORA-19202: Error occurred in XML processing
    LSX-00213: only 0 occurrences of particle "ADDR", minimum is 1
    ORA-06512: at "SYS.XMLTYPE", line 354
    ORA-06512: at line 13
    SQL>

Maybe you are looking for

  • Validate GL Account at SRM shopping cart at account assignment level

    Hi, In the SRM shopping cart system, at Account Assignment Overview level, is there any BADI or user exit or enhancement options to validate the GL Account when the account is selected/key-in? I try BADI for BBP_DETERMINE_ACCT, BBP_MESSAGES_BADI and

  • Upon "Enter Time Machine", viewing of TM/TC backups freezes

    When viewing TM/TC backups, after clicking on "Enter Time Machine", I have to "option/cmd/esc" out of TM/TC to get out of it -- once i've entered into it -- under the following conditions: Configuration: The freezing is seen in the following configur

  • Handling Out-of-Range and Overflow

    How to deal with Out-of-Range and Overflow? Suppose I have a SQL table with one column of datatype "tinyint". tinyint's range is 0-255. Table: create table xyz (     userid tinyint not null auto_increment, After inserting 256 rows, we cannot insert a

  • Query to find the space required to reduce the thershold.

    There are tablespaces where the current usage is crossed 90% and we are getting alerts. I want to know how much space required to add for these tablespaces ( datafiles) so that  current usage can be reduced to 80 %. or 70 % Is the any SQL query to fi

  • Can I restore my iPhone from a previous backup (Not latest)

    Hi, Yesterday I restored my phone to factory settings (Had backed up prior to this) to try and fix a problem with my screen after speaking to an Apple Rep. I did this, and didn't restore from back up as I had read on many forums it could of been an i