Using for-each for input into a database adapter

As input to a Web service I have an XSD that has parent elements and two unbounded child elements. I want to use XSLT to loop through the child elements to include them as comma separated strings for use in an IN clause in the query of the database adapter. I have the following XSLT in the input to database adapter XSL:
<db:child_elements>
  <xsl:attribute name="xsi:nil">
    <xsl:value-of select="/inp1:path/inp1:to/inp1:child_elements/@xsi:nil"/>
  </xsl:attribute>
  <xsl:for-each select="/inp1:path/inp1:to/inp1:child_elements/inpl:child_elements">
    <xsl:value-of select="."/>
    <xsl:if test="position() != last()">
      <xsl:text>,</xsl:text>
    </xsl:if>
  </xsl:for-each>
</db:child_elements>I am getting three error:
1) Error: Invalid Usage of <for-each> Element
2) Error: Invalid Usage of <if> Element
3) Error: This node is already mapped, repeating nodes not supported : "/db:databaseAdapterInput/db:child_elements"
Any idea of what the problem is here? Are for-each loops and if statements simply not allowed in Oracle SOA Suite? Thanks in advance!

For SQL Server 2005+ you can use the OUTPUT clause. E.g.
DECLARE @Source TABLE ( ID INT, Payload INT );
DECLARE @Destination TABLE
ID INT IDENTITY ,
Payload INT
DECLARE @IdentityValues TABLE ( ID INT );
INSERT INTO @Source
VALUES ( 1, 1 ),
( 2, 2 ),
( 3, 3 );
INSERT INTO @Destination
( Payload )
VALUES ( 0 );
INSERT INTO @Destination
( Payload )
OUTPUT INSERTED.ID
INTO @IdentityValues
SELECT S.Payload
FROM @Source S;
SELECT D.ID ,
D.Payload
FROM @Destination D;
SELECT IV.ID
FROM @IdentityValues IV;

Similar Messages

  • Is there a linear equations VI thatI can use for inputting the coefficients with variables attached to them? Thank you.

    Is there a linear equation VI that I can use for inputting the coefficients with variables attached to them? I am currently studying elec engineering and am in the thick of transient analysis. It is very time consuming figuring the mesh and nodal analysis in the transform domain. With 3 branches in a mesh analysis the resistors, inductors and capacitors are represented with variable s in them. I need to determine in the transform domain then convert to the time domain. One equation goes like this: (3+2s+1/4s)i1s - (2s)i2s - (1/4s)i3s = 6/s -6. The other equations are similar. I must keep the variable s in the equation and solve it with s in the result. I made several VIs for determining simultaneous linear equations some for complex numbers and they work great. This one has me a little stumped. I thinking that maybe Labview doesn't have a VI for this. The other VIs were fine because you just plugged in the numbers and ran the VI and got your result. Any VIs that do LaPlace transform operations?
    Thank you.
    Tom

    Hello Tom,
    You can find a VI for doing Laplace transforms in Functions->Analyze->Signal Processing->Frequency Domain (this VI is only available in the Full and Professional versions).
    You may also find the following tutorial of help in working with linear systems in LabVIEW.
    Linear Systems in LabVIEW
    Keep up to date on the latest PXI news at twitter.com/pxi

  • How do i display vector values to use for insesrting inot a database?

    does anyone know how i can retrieve values from a vector and use this to insert into a database?
    i have tied array but its not working..
    here is part of my code:
    Vector p=new Vector();
                                  try{
              //go to server n store values in vector p                    
                   SFlight f= new SFlight();
                                            p=f.View(destination,date,time);
                                  catch(Exception w)
                                       System.out.println(w.getMessage());
    //to insert values in the cache from server
    int y=0;
         String data[][]=new String [10][10];;
                                                                          for(int i=0;i<p.size();i++)
                                                      //Flight is my serialisable class containing num,nam,etc     
                   Flight tm=(Flight)p.elementAt(i);
                                                                                         data[y][0]=tm.num;
                                                                                         data[y][1]=tm.nam;
                                                                                         data[y][2]=tm.op;
                                                                                         data[y][3]=tm.des;
                                                                                         data[y][4]=tm.dat;
                                                                                         data[y][5]=tm.Nseat;
                                                                                         data[y][6]=tm.Stime;
                                                                                         y++;
                                                                               //System.out.println(p.elementAt(1));               }
                   }                                                                           try{
                                                      String query3="INSERT INTO Cache(FltName,Operator,Destination,Date,NumSeat,Ctime) VALUES (?????????);                                             
         int result3=Stmt.executeUpdate(query3);
                                                      if (result3==1)
                                                      System.out.println( "Record inserted successfully");
                                                      Stmt.close();
                                                      Conn.close();
                                                      else
                                                      System.out.println( "Record not inserted");
                                       }try
                                                      catch (SQLException eq)
                                                      System.out.println("Exception in SQL occured at query level??");
    return p;
    can anyone please help me with this..its very important..

    I appreciate the offer. However, for somestrange
    reason, I have no shortage of people ready,willing,
    and able to give me a good smack upside the
    head.
    Yeah, sorry, that's a bug in the reality matrix.
    We'll get around that. In the meantime: wear ahelmet.
    Franks and BEANS!!!!Yeah, but - how'd you get the beans above the franks?

  • Date Format on OWB 11.1.0.7 to use for input parameter for a mapping

    All,
    What is the Date Format on OWB 11.1.0.7 to use for passing in an input parameter for a mapping to execute?
    I have tried '01-01-2010','01-JAN-2010','01.01.2010', 01/01/2010 and I get the following error:
    Error RPE-01003: An infrastructure condition prevented the request from completing.
    Error RPE-01038: Failed to evaluate expression declare l_expression DATE := 01/01/2010;begin :result := wb_rt_conversions.from_date(l_expression);end;. Please modify the expression, redeploy and retry again.
    RA-06550: line 1, column 32:
    PLS-00382: expression is of wrong type
    ORA-06550: line 1, column 24:
    PL/SQL: Item ignored
    ORA-06550: line 1, column 90:
    PLS-00320: the declaration of the type of this expression is incomplete or malformed
    ORA-06550: line 1, column 51:
    PL/SQL: Statement ignored
    I am using a Mapping Input parameter object and have a START_DATE_IN as a DATE and an END_DATE_IN as a DATE
    Any information you could provide would be greatly appreciated.
    Thanks,
    Shaun

    Hello Shaun,
    The function wb_rt_conversions.from_date is (at least in OWB10.2) overloaded and can with input-types as
    date, timestamp_unconstrained, timestamp_tz_unconstrained, timestamp_ltz_unconstrained or varchar2.
    If it doesn't work with varchar2 I would try Date:
    For example: to_date('2010-01-01','YYYY-MM-DD')
    I also found this thread:
    http://kr.forums.oracle.com/forums/thread.jspa?threadID=608257
    Hoping this helps...
    Guenther

  • Use Spry to insert data into a database?

    I'm new to Spry, so I have a question:
    Can I use Spry to insert data into a MySQL database without
    reloading the site?
    Reading data from XML file works fine, but I don't know if
    writing is possible..

    I don't get it... I tried this:
    <script type="text/javascript" src="spry/xpath.js"
    /></script>
    <script type="text/javascript" src="spry/SpryData.js"
    /></script>
    <script type="text/javascript">
    /* <![CDATA[ */
    function subscribe() {
    var subscribe;
    var info =
    document.getElementById("subscription_info").value;
    if (document.getElementsByName("subscription")[0].checked ==
    true) {
    subscribe = "ja";
    else {
    subscribe = "nein";
    var dsSubscribe = new
    Spry.Data.XMLDataSet("include/inc_subscribe.php?subscribe="+subscribe+"&info="+info+"&sit e=<?=$_GET['site'];?>",
    "subscription/ok");
    /* ]]> */
    </script>
    <div id="infos">
    <input type="radio" name="subscription" value="ja" />
    dabei
    <input type="radio" name="subscription" value="nein"
    /> nicht dabei
    <input type='text' class='text'
    id='subscription_info_text' />
    <input type='submit' id="subscription_submit"
    value='Eintragen' onClick="subscribe()" />
    </div>
    But the data isn't inserted into the mysql database. When I
    start the php script directly, it works, so I think it's not a php
    problem.

  • Placeholder for IN condition in database adapter

    I'd like to pass a parameter to a database adapter which will modify the "in condition" portion in a select. For example:
    select firstname
    from xxx
    where
    lastname in (#arg1)
    Is this the correct syntax? If so, what values will arg1 take? Something like this string (including quotes)?
    'lname1','lname2','lname3'
    Or is it something else?
    So,
    1. what is the syntax in the sql statement in the db adapter
    2. what is the syntax of the data passed in to this placeholder?

    Thanks for your response.
    Actually, I'm trying to test this out via the web service tester in Enterprise Manager. When I insert the following into the tester's generated form field, execution of the sql fails, apparently for a missing value:
    'lname1','lname2','lname3'
    I'm not sure I understand your comment "while passing the values if it has varchar2 values appened it with single quotes and send into the adapter". Where would I have any access to a varchar2 in the adapter or the mediator that feeds it?

  • Intermittence for execute Polling with DataBase Adapter in OSB11g

    Hello Guys,
    I'm having a problem running the polling DataBase Adapter OSB11g. The creation of the adapter was made in Jdeveloper 11.
    The problem is:
    Intermittence to run the polling DataBase. Sometimes it works, other time it does not work.
    Displays the following exception:
    *<Info> <JCA_FRAMEWORK_AND_ADAPTER> <BEA-000000> <<oracle.tip.adapter.db.InboundWork handleException> BINDING.JCA-11624*
    DBActivationSpec Polling Exception.
    *Query name: [BD_XPTO_NOTIFICA_XPTOSelect], Descriptor name: [BD_XPTO_NOTIFICA_PRICING.XPTO]. Polling the database for events failed on this iteration.*
    Caused by JTS transaction was marked rollback only.
    This exception is considered retriable, likely due to a communication failure.  Polling will be attempted again next polling interval.
    This is a BUG? Have Fix?
    Tks,
    Azevedo, Artur.

    It looks like a database issue or a XA configuration issue? What database you're polling? Oracle? Sybase? Check if your database is supported...
    Cheers,
    Vlad

  • How to change color of the caret (text cursor) in a TLFTextField used for input.

    This might be a very simple Question, but I have looked and searched everywhere and don't find how to change the color of the caret in a input TextField.
    any ideas?
    Thank you in forward.
    GV

    This was driving me crazy, too--and the previous answers did not seem to work. I eventually found that if I click one of the data symbols in the graph in exactly the right spot (see below), it selects only the data symbols and not the line. I can tell this because the little selection dots will be around each data symbol, but no selection dots will be on the line between the data symbols - like the graphic in Yvan's answer. Then and only then will the color symbol in the tool bar show the color of the data symbol, instead of the color of the line. I believe that you then have to first click on the color swatch in the toolbar and then select your color (or choose Show Colors and select from the color tool). Just clicking a color in the crayon box, for example, did not seem to work unless I first clicked on the color swatch in the toolbar, then clicked Show Colors on that dropdown, and +only then+ clicked the crayon or whatever.
    _The right spot to click_ seems to be just above the exact center of the data symbol, at least for the diamond shape symbol that I prefer. Sometimes it takes several tries to hit the right spot. If I miss it, the whole line is selected, which is indicated by the little selection dots on the line, between the data symbols. When I click the right spot, those selection dots go away, leaving only the data symbols selected. Then I can change the color, as described above.
    I hope this works for you too.

  • What charcterset to use for Thai - with 10 database?

    Hi All,
    We have an application with below specification
    Oracle database - 10.2.0
    Forms and reports - 10g
    In the front end application using (forms) we are not able to view Thai charactes. The NLS_LANG for form server is AL32UTF8. With this setting we can see Chinese and Japanese characters properly but not Thai.
    The reports generated using oracle reports show the Thai characters and NLS_LANG for report server is = UTF8. SoI tried changing the form's nls_lang = UTF8 but no improvement after this change.
    Could you please tell me what do I need to change to view Thai characters?
    Thanks in advance
    Priya

    Hi,
    Do I need to post this query in different category?
    Regards,
    Priya

  • I cannot get MainStage 3 to find the Aggregate Device I am trying to use for input.  I have two USB interfaces and need to use both for input.

    The MainStage 3 Audio preferences window will not find the Aggregate Device input.  I have both an Apogee Jam and a MOTU Mike Ultralight in USB ports.  The Audio aggregator finds them and treats them as one device.  The Aggregate Device does not show up in either Logic or MainStage.  However, unlike Logic, MainStage does not show "System Settings" an input device.

    The iphone 3G can only support 4.2.1
    There are no newer updates availabel for this model.

  • SE16 for tables, what to use for looking into structures

    Hi,
    I want to check a structure field for 700 materials on contents. I don't have a report to check them and I would like to check them in the same way as you can check table-fields with SE16. Is this possible?
    Willem-jan Bos

    Dear Willem-jan Bos,
    It is <b>not possible</b> to see the data in structures as they do not store the data. You can only see the data of tables and views in SE16/SE11. Structures are used in tables or in programs. They never store the data.
    Regards,
    Naveen.

  • Can the sync server use for sync the custom database?

    Hi,
    I review some document from OCS. Sync server (mobile data sync) will connect to the calendar server to sync data. Anyway, if I would like to sync custom data, not with calendar server, is it possible? If so, how? (Can I connect mobile data sync server to the oracle database directly without calendar server?)
    Further question, if the database contain binary large object (files), can I sync just only attribute of the file (for example if the name of the file is changed.)
    Thanks,
    Byrd

    Sorry. No this is not something that is supported.

  • What is the ReplacesDialogIDTime column used for in the CDR database?

    I have been writing some reports using SQL aganist the Lync CDR database - looking mainly at the SessionDetails and VoipDetails tables.
    I have come across some instances where the duration of the call (session start - session end) is not acurrate, but I can see other records in the sessiondetails table with the replacesdialogidTime is the same as the SessionIDTime in the original record. 
    Does anyone know why Lync does this and why ?
     

    There is no HashCode class in Coherence (at least I cannot find one in the 3.5.2 jar).
    I can only assume you actually mean the hashCode method, which is part of standard Java and is declared on the Object class that every class inherits from. It is actually quite important to understand how to implement it properly if you are going to override this method in your classes (which you probably should in domain objects). Try reading this which I pulled at random from Google: http://www.ibm.com/developerworks/java/library/j-jtp05273.html
    JK.

  • Different family class used for input  and output when working with sockets

    I have seen more or less everywhere the following code to open a socket and to receive input and send output through it:
    Socket server = new Socket("anyservername", 25):
    OutputStream out = server.getOutputStream();
    PrintWriter pout = new PrintWriter (out, true);
    pout.println("Hello");
    InputStream in = server.getInputStream();
    BufferedReader bin = new BufferedReader (new InputStreamReader(in));
    String response = bin.readLine();
    What I do not understand is:
    Why the BufferedReader needs InputStreamReader as an argument whereas printwriter does not want the OutputStreamReader as an argument but it is OK with just the OutPutStream?
    I would tend to believe that they should be more or less at the same level and use the same arguments?.
    In that sense if I use BufferWriter instead of PrintWriter I bet It should be OK the following code?:
    OutputStream out = server.getOutputStream();
    BufferedWriter bout = new BufferedWriter (out);
    String myOut = bout.writeLine();
    Cheers
    Umbi
    Edited by: Imbu on Jun 2, 2008 2:40 PM

    1. Does it even compile?
    2. While there is a fair amount of symmetry between reader and writer classes, don't assume it's exhaustive. Your best friend is the API:
    [http://java.sun.com/javase/6/docs/api/]
    3. Those were just examples. Code it the way you feel is best. I would specify charsets to make sure the encodings were platform independent. Networking and all that, don't you know...

  • Using keyboard to control inputs into realtime VI

    Hi,
    I have a vi which runs on my compactRIO and controls the balancing of a robot. The robot balances pretty well but it would be nice to move it around. I have two slider control linked to the motor outputs of the control system so i can simply add or subtract a voltage from the motors so they move in a certain direction and hence move it around.
    However sliding the vertical slider is not ideal especially when you need to move both motors at the same time to get it to move diagonally for example. Is it possible to use the keys on my laptop (which is hooked up to the compactRIO) to add small values to the controls on the front panels. So for example i could press the up key and it would add 0.01 to the vertical slider and hence add a little voltage to the motor when it ran through the VI. This would make controlling it a lot easier and also good for it's intended use as a demonstrator for uni classes as they could just intuitively use the keyboard to control it rather than having to know all about labview.
    Thanks,
    Sam

    The attached uses the left and right cursor keys to change a value. Adapt as required.
    Ian
    Attachments:
    cursor keys.vi ‏13 KB

Maybe you are looking for

  • Is Siri ever going to learn portuguese??!?

    It's been years since Siri was launched and still no Portuguese? Doesn't Apple think Brazil and Portugal are a good market? They charge 3x more for an iPhone in Brazil, compared to the US, and still don't deliver the full experience. It is a shame!

  • Hide empty merge fields

    Hi! I am merging address book fields into a Pages document, but not all of the address book contacts have data in all of the fields in the Pages document. When I go to print, the empty fields show up in the document with the field name (e.g. Other Na

  • How do I stop PSE 13 organizer from quitting unexpectedly when working with the PSE editor

    Every time I'm working in the editor I get  the error message "the organizer has quit unexpectedly" I have uninstalled and reinstalled as per chat supports recommendation with no improvement. I have studied the Adobe support information and don't see

  • Gmail - Send Mail/Messages

    Hello, WHat is the difference between the Sent Mail Folder and the Sent Messages Folder on my Gmail accounts on my iPhone? I use IMAP. Any help would be much appreciated.

  • Mac App Store keeps crashing on multiple machines, but not on all of them

    I have an I mac running 10.6.8.  Whenever I open the app store it logs inot my account successfully, but when I choose an app I have already pruchased, or a new app to purchase, I get a whirling disk after about 5 seconds, and cannot proceed further.