Query in Insert statement with JDBC Rx adapter

Hi,
This is a FILE to JDBC scenario.
My target datatype is like this with sample payload values
statement_s
statement_s
   action='INSERT"
  access
    A=1234
    B=1002
key
   A=1234
   B ="10%"
     compareOperation= LIKE
A(1..1) is primary key in DB and B(0..1) colunm is an optional one.
I want to know if such kind of Insert query with(LIKE operator) is possible.
Please reply me ASAP.
Edited by: ram pranav on Feb 18, 2009 10:28 PM

Hi Ram,
IN case of "UPDATE_INSERT", you can use the KEY tag in your structure. Also you can provide LIKE as an attribute to the KEY element as follows :
<key1>
     <col4 compareOperation=u201DLIKEu201D>val%</col4>
</key1>
But when you are trying to insert the data_, the <key> tags will be ignored and only <access> will be considered._
action=UPDATE_INSERT
The statement has the same format as for the UPDATE action. Initially, the same action is executed as for UPDATE. If no update to the database table can be made for this action (the condition does not apply to any table entry), values of the table described in the <access> element are inserted in accordance with the description of the action INSERT. <key> elements are ignored in this case.
The response document has the following format; one of the two values is always 0 because either an UPDATE or an INSERT action is always executed:
Go through the link I have provided earlier.
Thanks,
Pooja Pandey

Similar Messages

  • INSERT statement with JSP

              Does anyone know how to create an INSERT statement with JSP using
              variables??
              I can do the insert if I code the values of the variables in the statement,
              but when I try to use variables to do the insert it tries to insert the
              variable name and not the value of the variable into the table.
              Thanks,
              Doug
              

    "Doug Schaible" <[email protected]> wrote in message news:<bicO7.1279268$[email protected]>...
              > I can do the insert if I code the values of the variables in the statement,
              > but when I try to use variables to do the insert it tries to insert the
              > variable name and not the value of the variable into the table.
              Doug,
              I think you missed the <%= blahblah %> syntax.
              Regards
              drit
              

  • Update- statement in JDBC sender Adapter

    Hi ,
    I have a requirement where I am trying to fetch data from ODS based on some flag and immediately I want to update the flag status . So I used selected and update in JDBC sender adapter .
    But I have one question , in the small timeframe where  XI has done a select and just before  XI could  issue the update statement  if a new record is added to ODS . Then  that new record will also get updated though it wasnot selected in select statement .
    Can someone let me know how to overcome this problem ; as I want to make sure I update only those recrods which are selected in select statement ??
    Thanks & Regards,
    Suvarna

    Hi,
    Check out the following thread. It gives the exact answer to this question.
    JDBC Sender Update Query
    One of the replies in the above thread:
    I put in an OSS note asking this exact question with your specific example, and got a reply. I was referred to OSS note 0000831162, where it is explained very unambiguously that the SELECT and UPDATE queries are run in the same transaction.
    Regards,
    P.Venkat
    Message was edited by:
            Venkataramanan

  • Problem with JDBC Sender adapter

    hi guys!
    I´ve problem in PI 7.0, with the JDBC Sender Adapter, execute select sentence and update status in Oracle database.
    In RWB Message Monitoring and SXMB_MONI I can't see any message.
    Someone have any idea how to fix it?
    Thanks in advance.

    Hi David,
    First check on the sender communication channel, if no data has been picked up by PI on channel,
    then check the configuration of channel in the ID, especially select query.
    If that is ok, then ask the sender application team(oracle database team) to run the query on their side
    and to check if they are getting any data.
    There could be the possibility of error in data also.
    -Supriya.

  • Why can't i use "INNER JOIN" in a query for SQL Server with JDBC??????

    Hi,
    I'm trying to execute some SQL queries and I just don't understand what's wrong.
    I�m using Tomcat and SQL Server in order to do this, but when I�m try to execute a query with a INNER JOIN statements Tomcat raise a SQL exception... at the very first time I thought there was a problem with database connection but I realize that a simple query to a table works pretty well. then I found out some problems with JDBC:ODBC.... so I install JDBC for SQL Server 2000 and test with the same simple query and works..... so, I come to a conclusion.... INNER JOIN or JOIN statements can't be used in JDBC..... please... somebody tell I�m wrong and give me a hand...
    I'm using TOMCAT 4 and JDK 1.4 SQL Server 2000
    Error occurs when executeQuery() is called.... not prepareStatement().... ??????
    Driver DriverRecResult = (Driver)Class.forName(driver).newInstance();
    Connection ConnRecResult = DriverManager.getConnection(DSN,user,password);
    PreparedStatement StatementRecResult = ConnRecResult.prepareStatement(query);
    ResultSet RecResult = StatementRecResult.executeQuery(); <---- Exception raise here
    So much tahnks in advance,

    That's exactly what I think, driver it's raising the exception, but I don't know why.... i test the same query with INNER JOIN directly from SQL Query Analyser and it's works perfectly, my problem ain't SQL, but JSP and JDBC 'cause i'm a newbie about these issues.
    Common sense tell me possible problems lie in SQLServer drivers 'cause i run the same pages on JRUN through jdbc:odbc and do works well, but by now i just depend on Tomcat.....
    I've installed SQL Server drivers for JDBC but i just find it doesn't work fully... could be the version of JDK i've installed? what version do i need?
    ( I'm running Tomcat 4 with JDK 1.4 & SQL Server 2000 W2K )
    thanks for reply.

  • Challenging issue with JDBC sender adapter

    Hello Guys
    I have this requirement
    From Oracle Database I have to read to tables  one for the header and one for the detailes and map the result to one RFC.
    I have only  worked with one table at the time with the JDBC sender adapter but never with 2  tables
    My challenges are
    1 - How I can read the 2 tables at the same select statement , I suppose I have to use a join with 2 identical fields , so far so good ,but how I can handle multiple records
    suppose the result is 10 new different records which each of the recored has to be mapped to the RFC , then we will have 10 RFC calls.
    how can I do the mapping in this case.
    2 - How can I update the 2 tables at the samme time and flag them as processed , as far as I know we can not use 2 update statement in the same JDBC sender
    any help will do
    Thanks in advance.

    Hi
    Thanks for the replayes
    The RFC is used to create and Invoice Idoc , It has to be one record (Header and Item ) to one RFC.
    a JDBC to IDoc can also be used , but we have to update another table in SAP that is why the RFC,
    My doubt is how the Data type for the sender JDBC should look like , as mentioned I have 2 tables to fetch data from
    <Invoice>
    <Header> 1 -- 1
    <f1>
    <f2>
    <f3>
    </Header>
    <Item> 1--n
    <f1>
    <f2>
    <f3>
    </Item>
    </Invoice>
    The sender JDBC returns
    <Invoice>
    <row>
    <f1>
    <f2>
    <f3>
    </row>
    </Invoice>
    How can I replicate the data type to meet the JDBC sender structure.
    and regarding the mapping do I have to change the occurrunce to 0 -- unbounded
    regarding the update Ragu is right in his suggestion
    Table1 can be used as primary table, Table2 can be used as Secondary table.. u will have key field to link both table.
    So Just Updating only Primary Table(Table1) will helps on this.
    Thanks.

  • Insert statement with timezone asking for parameter

    I have an insert statement in a file.
    When the whole file is executed it inserts around 300 rows in to table.
    One of the insert statement is failing. This insert statement inserts a query into column of a table.
    It is as following
    Insert into hr.TABLE_PATH
    (PATH, TABLE_OWNER_NAME, TABLE_NAME, PATH_NAME, TABLE_ACCESS_PATH_DESC, TABLE_PATH_SQL_TXT, PROCESS_CODE, DELETE_IND, ACCESS_ID)
    Values
    (290, HR, EMPLOYEES, 'Reconc', 'XYZ', 'SELECT COUNT(*) FROM (SELECT hr.product, TO_TIMESTAMP (TO_CHAR (FROM_TZ (sm.product_tmstp, 'GMT') AT TIME ZONE 'US/Central', 'YYYY-MM-DD HH24:MI:SS.FF6'), 'YYYY-MM-DD HH24:MI:SS.FF6') AS product_tmstp FROM ( SELECT DISTINCT(product) FROM hr.updated_table) upr, RH.product AS OF SCN :1 spr, RH.milestone AS OF SCN :1 sm WHERE spr.product = upr.product AND sm.product = spr.product MINUS SELECT prf.product, mi.product_tmstp FROM ( SELECT MAX(execute_id) exeute_id FROM hr.slave_execute ) cmr, hr.prod prf, hr.hr_info mi WHERE prf.execute_id = cmr.execute_id AND mi.milestone_group_id = prf.milestone_group_id )', 'N ', 'N', 2);
    The problem is with this piece of insert:
    TO_TIMESTAMP (TO_CHAR (FROM_TZ (sm.product_tmstp, 'GMT') AT TIME ZONE 'US/Central', 'YYYY-MM-DD HH24:MI:SS.FF6'), 'YYYY-MM-DD HH24:MI:SS.FF6') AS product_tmstp
    : --> is being considered as parameter.
    Where as the whole sql thing needs to get inserted into the table.

    If you are inserting a string, then any quotes inside the string should be replaced with two single quotes,
    try this,
    INSERT INTO hr.TABLE_PATH (PATH,
                               TABLE_OWNER_NAME,
                               TABLE_NAME,
                               PATH_NAME,
                               TABLE_ACCESS_PATH_DESC,
                               TABLE_PATH_SQL_TXT,
                               PROCESS_CODE,
                               DELETE_IND,
                               ACCESS_ID)
    VALUES (
             290,
             HR,
             EMPLOYEES,
             'Reconc',
             'XYZ',
             'SELECT COUNT(*) FROM (SELECT hr.product, TO_TIMESTAMP (TO_CHAR (FROM_TZ (sm.product_tmstp, ''GMT'') AT TIME ZONE ''US/Central'', ''YYYY-MM-DD HH24:MI:SS.FF6''), ''YYYY-MM-DD HH24:MI:SS.FF6'') AS product_tmstp FROM ( SELECT DISTINCT(product) FROM hr.updated_table) upr, RH.product AS OF SCN :1 spr, RH.milestone AS OF SCN :1 sm WHERE spr.product = upr.product AND sm.product = spr.product MINUS SELECT prf.product, mi.product_tmstp FROM ( SELECT MAX(execute_id) exeute_id FROM hr.slave_execute ) cmr, hr.prod prf, hr.hr_info mi WHERE prf.execute_id = cmr.execute_id AND mi.milestone_group_id = prf.milestone_group_id )',
             'N ',
             'N',
             2
           );Note the
    TO_TIMESTAMP (TO_CHAR (FROM_TZ (sm.product_tmstp, ''GMT'') AT TIME ZONE ''US/Central'', ''YYYY-MM-DD HH24:MI:SS.FF6''), ''YYYY-MM-DD HH24:MI:SS.FF6'') AS product_tmstp First off, How are you inserting the data? using sqlldr or utl_file?
    If you are inseting using a script from Sqlplus
    use
    SET DEFINE OFFjust to make sure nothing is treated as a parameter.
    G.
    Edited by: Ganesh Srivatsav on Apr 6, 2011 5:20 PM

  • B1out - B1isql - Pass value of query to insert statement.

    Experts,
    Perhaps it is because it is late and I am very tired, but I feel as though I am overlooking some obvious solution to the following scenario.
    I have created a scenario that is making a SQL Call to a database, and I need to pass the values from that query to a table in a B1 DB.
    I am using an outbound channel of B1, and the B1isql type.
    here is my issue,
    I know that I can pass the value of atom0 JDBC:JOBID to my Field tag.
    However, the insert statement uses the tag attribute value="" to pass the values to the DB.
    <Table id="invoicesource" keylist="jobid" task="A" del="">
         <Field id="JOBID" value="" wrapchar="False"><xsl:value-of select="jdbc:JOBID"/></Field>
    </Table>
    I'd like to be able to pass the <value-of select= />, into the value="" attribute instead.
    Any insight would be greatly appreciated.
    warmest regards,
    Lucas Fischer

    I used standard SQL out instead, since it was for custom DB object, and not SAP B1 table, issue resolved.
    Edited by: Lucas Fischer on Jun 28, 2011 12:01 PM

  • Parameters in select statement in JDBC Sender Adapter

    Hi,
    Is it possible to construct a SQL select statement with some parameters (for example: #currentdate )?
    (for sender JBDC adapter)
    Thank you

    hi,
    you can very well construct a select statement.
    The Source data type should be of this format:
    <resultset>
    <row>
    <column-name1>column-value</ column-name1>
    <column-name2>column-value</ column-name2>
    <column-name3>column-value</ column-name3>
    </row>
    <row>
    <column-name1>column-value</ column-name1>
    <column-name2>column-value</ column-name2>
    <column-name3>column-value</ column-name3>
    </row>
    </resultset>
    try this link:
      http://help.sap.com/saphelp_nw04/helpdata/en/22/b4d13b633f7748b4d34f3191529946/frameset.htm
    regards,
    Priyanka

  • Select query and Insert statement performance

    Hi all,
    Can anyone plz guide us on below problem I am facing ?
    1) One of the simple Insert statement runs very slow..What might be the reason? Its simple table without any LOBs ,LONG or so. Everything else in the DB works fine.
    2) one of the SELECT statement runs very slow. It selects all records (around 1000) from a table..How can i improve its performance?
    3)Which columns in the Master and its detail tables should be indexed to improve Query performance on them.
    Many Thanks
    Regards
    sandeep

    To get an answer to your questions you have to post some informations about your system:
    1. operating system
    2. RAM
    3. oracle version
    4. init.ora
    Thomas

  • Insert statement with Date, time into Oracle

    Hi,
    I've got the following statement that I'm trying to insert into Oracle. Actually had to change up the format to dd-mm-yy to get it to insert the date correctly, not sure why, but I've got it "supposedly" formatted to also insert the hours, min., seconds into the db record, but it's not catching it.
    My code:
    INSERT INTO VOTETBL
    (CHANGE_CTRL_ID,BUSVP,BRANCH,VOTE,VOTE_TIMESTAMP)
    VALUES (?, ?,?,?,to_date(sysdate, 'dd-mm-yy hh24:mi:ss'));Shouldn't the sysdate capture all those elements sufficiently? The day, month, year get inserted correctly with this, but not so for the time portion.
    Any suggestions is welcomed.
    Thx.

    ok, thanks.
    I tried making a result set with the following:
    Statement stmt = connection.createStatement(ResultSet.TYPE_SCROLL_SENSITIVE, ResultSet.CONCUR_READ_ONLY);
    ResultSet rst = stmt.executeQuery("select to_char(sysdate) from dual");
    Date dualtimestamp = (rst.getDate("sysdate"));But it makes the servlet blow up! Not sure why either, because if I enter that exact statement in Oracle, it pulls back the date and time just like I aim to. But not embedded in the result set statement within the servlet.
    It breaks up somehow and doesn't get that result!

  • Insert statement with loop function

    Hello all,
    I'm new with the loop function
    What need to do is to use a select statement with a condition
    This output needs to be inserted in a table
    The values of the condition are stored also in a table
    It will be something like this:
    BEGIN
      FOR i IN (select nrs from table1)  LOOP
        INSERT INTO table_out_loop
        SELECT * FROM bigtable_vw
        WHERE nr = i
      END LOOP ;
    END ;
    I cant use a direct insert_into function in this case so I need the plsql to 'look' for the values 1 by 1 from the table1
    Any help would be appreciated

    Can't you just:
        insert into table_out_loop
        select *
        from   bigtable_vw
        where  nr in (select nrs from table1);
    If not, then post a better example and/or rephrase the question...

  • Creating Multiple INSERT statements with SQL

    is there a way to create multiple INSERT staements with SQL .
    Example scenario : This is only example but i have lot of data in the real time.
    sql : Select Emplid from Table A where Emplid between 100 and 350 will retun me 50 rows . i want to insert those rows into another table.
    I am looking for output like below instead of Giving output just as EMPLIDs
    Insert into PS_LM_DATA ( EMPLID ) values ( 123 )
    Insert into PS_LM_DATA ( EMPLID ) values ( 234 )
    Insert into PS_LM_DATA ( EMPLID ) values ( 334 )
    and so on....
    thanks ,
    Karu

    If you are inserting into another table, you could use
    insert into PS_LM_DATA ( EMPLID ) 
    select Emplid from Table A where Emplid between 100 and 350Example:
    SQL> insert into emp2(empno) select empno from emp;
    14 rows created.
    SQL> insert into emp2(empno) select empno from emp where empno between 7369 and 7788;
    8 rows created.

  • Problem with JDBC Recever adapter while inserting the Hebrew charecters

    HI All,
    I am using the JDBC adapter at reciver side.
    While I am inserting any hebrew charecters in database table all are getting converted into ??????
    for this Do I need to use any specific datatype?
    Please suggest...
    Best Regards
    Manish

    Hi,
    What it is showing in PI Target structure(Moni),it is showing valid format,if yes then speak with your data base team they may change data base settings to support your Hebrew characters.
    Regards,
    Raj

  • Error With JDBC receiver adapter

    Hi Guys,
                  I am working with File to Jdbc scenario.at the file side the process is working fine.the file is picked up by the file adapter and send it XI.then XI sends the data to JDBC it shows an error in receiver side.the error is as follws
    Message processing failed. Cause: com.sap.aii.af.ra.ms.api.RecoverableException: Error processing request in sax parser: Error when executing statement for table/stored proc. 'sap_alt_spec' (structure 'Statementname'): java.sql.SQLException: ORA-00928: missing SELECT keyword
    so can any one tell me the solution to resolve the error?its urjent.

    Hi,
    please refer:
    for configuration of JDBC adpt-
    http://help.sap.com/saphelp_nw04/helpdata/en/64/ce4e886334ec4ea7c2712e11cc567c/frameset.htm
    for XML document formats(this is much imp.)-
    http://help.sap.com/saphelp_nw04/helpdata/en/64/ce4e886334ec4ea7c2712e11cc567c/frameset.htm
    Ranjit

Maybe you are looking for

  • Can't launch Safari after Software Update

    I can't start Safari anymore and I don't know what to do. In short, click on the dock and no bounce. Double-click on the icon within Applications and it doesn't launch either. These problems, I'm guessing are a result of the combination of objects de

  • XK01 creating a vendor  issues

    Creating a vendor in XK01 , system allow me to fill up all the screens for any account group when I try to save it  there is a message saying that "account 100025 already exist" and yes already exist and I do not know why the system is trying to assi

  • Weblogic 7 SP2 - problem in ejb-jar.xml

    Hi, I have a problem when trying to move from Weblogic 7 to 7 SP2. In some of our ejb-jar.xml descriptors we have something like the following: <!ENTITY ENTITY_PROP SYSTEM "Config/entity_config.txt"> then used this later on in the descriptor: <env-en

  • Headstart Installation Questions

    Could anyone help me with the following please? Examples of how Headstart users have been set up in other installations would be very useful. 1) When performing server side installation, four usernames are required - Repository Owner, Template Packag

  • TS1967 what to do if you with the "itunse conect" in the last stage of update

    what to do if you with the "itunse conect" in the last stage of update?