Select Query in the receiver JDBC

Hello all,
Is it Possible to use the select query in eceiver JDBC.
Thanks,
Srinivasa

Hi Srinivas,
You can either create the structure or can directly write the SQL_QUERY or| SQL_DML  statement where you will specifty the action SQL_QUERY | SQL_DML .
So you can use either XML SQL Format or Native SQL Format. Please see this help srini:
http://help.sap.com/saphelp_nw04/helpdata/en/2e/96fd3f2d14e869e10000000a155106/content.htm
Regards,
---Satish

Similar Messages

  • QUESTION abt "SQL_DML" of the Receiver JDBC Adapter

    HI ALL,
    i hav a doubt abt "SQL_DML" of the Receiver JDBC Adapter.
    i wanna use two SQL Statements in the "SQL_DML" structure to manipulate two tables.
    i.e.
    <root>
      <stmt>
        <Customers action="SQL_DML">
          <access>
                          INSERT INTO Customers VALUES (u2019$NAME$u2019, u2019$ADDRESS$', '$KEYFIELD$u2019);
                          INSERT INTO Companys VALUES('$NAME$')    
          </access>
          <key>
            <NAME>Company</NAME>
            <ADDRESS>Street 3 </ADDRESS>
            <KEYFIELD>CO</KEYFIELD>
          </key>
        </Customers>
      </stmt>
    </root>
    BUT i cant ascertain if it permit like this writting above ??
    Requset help in this regards.
    Thx in advance.
    brian

    Hi,
    You need to have two different statements. Each for one insert query. Your query will come under access tag and palceholders under kay tag. Action will remain same as you have given, but under both statements.
    Ex:
    <root>
    <stmt1>
    <Customers action="SQL_DML">
    <access>
    INSERT INTO Customers VALUES (u2019$NAME$u2019, u2019$ADDRESS$', '$KEYFIELD$u2019);
    </access>
    <key>
    <NAME>Company</NAME>
    <ADDRESS>Street 3 </ADDRESS>
    <KEYFIELD>CO</KEYFIELD>
    </key>
    </Customers>
    </stmt1>
    <stmt2>
    <Customers action="SQL_DML">
    <access>
    INSERT INTO Companys VALUES('$NAME$')
    </access>
    <key>
    <NAME>Company</NAME>
    </key>
    </Customers>
    </stmt2>
    </root>
    Hope this helps.
    Regards,
    Siddhesh S.Tawate
    Edited by: siddhesh tawate on Apr 24, 2009 8:10 AM

  • Problem in the receiver JDBC channel

    hi,
    I am facing some problem with the receiver JDBC channel which is trying to insert some data in ORACLE DB.  My sample input XML file is,
    <root>
    <statement>
    <table>EBILL_CUST_STATE_AGE_HDR2</table>
    <CUST_CODE>BA001</CUST_CODE>
    <CUST_ADDR>Rental Customer Name 1+Name 2street01+TEL: 0331694100
                           FAX:0331694103</CUST_ADDR>
    <CRD_LMT>1000000.00</CRD_LMT>
    <BG_AMT>1000000.00</BG_AMT>
    </statement>
    </root>
    Error stack is,
    Exception caught when executing statement for table/stored proc. 'EBILL_CUST_STATE_AGE_HDR2' (structure 'Statement_CUST_STATE_AGE_HDR2'):
    java.sql.SQLException: ORA-00917: missing comma
    Please help me in solving the issue ASAP.
    Thanks,
    Soorya

    Hi,
    It works like this
    <ROOT>
    <STATEMENT>
    <TABLENAME ACTION="INSERT">
    <TABLE>EBILL_CUST_STATE_AGE_HDR2</TABLE>
    <ACCESS>
    <CUST_CODE>BA001</CUST_CODE>
    <CUST_ADDR>Rental Customer Name 1+Name 2street01+TEL: 0331694100
    FAX:0331694103</CUST_ADDR>
    <CRD_LMT>1000000.00</CRD_LMT>
    <BG_AMT>1000000.00</BG_AMT>
    </ACCESS>
    </TABLENAME>
    </STATEMENT>
    </ROOT>
    Please refer the link.
    http://help.sap.com/erp2005_ehp_04/helpdata/EN/ae/d03341771b4c0de10000000a1550b0/frameset.htm
    Abid Mazhar

  • How to write selection Query for the following requirment.

    Hi All,
    I am new to ABAP, I need a help ,
    I need to select all plants(WERKS) from MARC at Plant/Material level,
    then I need to take all sales organozation(VKORG) from T001w,
    then I need the company code(BUKRS) from TVKO based on VKORG,
    then I need the currency key(WAERS) from T001 based on BUKRS,
    Can any one help me in writing selection Query for the same?
    Thanks All,
    Debrup.

    Hi,
    Its easy for you if you learn SELECT with JOIN to complete your task. So SEARCH the forum with SELECT statement and you will get a lot of examples using which you can write your own.
    If you struck up anywhere revert back.
    Regards
    Karthik D

  • How an INDEX of a Table got selected when a SELECT query hits the Database

    Hi All,
    How an Index got selected when a SELECT query hits the Database Table.
    My SELECT query is as ahown below.
        SELECT ebeln ebelp matnr FROM ekpo
                       APPENDING TABLE i_ebeln
                       FOR ALL ENTRIES IN i_mara_01
                       WHERE werks = p_werks      AND
                             matnr = i_mara_01-matnr AND
                             bstyp EQ 'F'         AND
                             loekz IN (' ' , 'S') AND
                             elikz = ' '          AND
                             ebeln IN s_ebeln     AND
                             pstyp IN ('0' , '3') AND
                             knttp = ' '          AND
                             ko_prctr IN r_prctr  AND
                             retpo = ''.
    The fields in the INDEX of the Table EKPO should be in the same sequence as in the WHERE clasuse?
    Regards,
    Viji

    Hi,
    You minimize the size of the result set by using the WHERE and HAVING clauses. To increase the efficiency of these clauses, you should formulate them to fit with the database table indexes.
    Database Indexes
    Indexes speed up data selection from the database. They consist of selected fields of a table, of which a copy is then made in sorted order. If you specify the index fields correctly in a condition in the WHERE or HAVING clause, the system only searches part of the index (index range scan).
    The primary index is always created automatically in the R/3 System. It consists of the primary key fields of the database table. This means that for each combination of fields in the index, there is a maximum of one line in the table. This kind of index is also known as UNIQUE. If you cannot use the primary index to determine the result set because, for example, none of the primary index fields occur in the WHERE or HAVING clause, the system searches through the entire table (full table scan). For this case, you can create secondary indexes, which can restrict the number of table entries searched to form the result set.
    reference : help.sap.com
    thanx.

  • Doubt in query statement in receiver jdbc

    HI
    Again a doubt in XML format for receiver jdbc.
    I want to execute a query
    select sum(col1) sum(col2) from tablename where startdate <= tdate.
    My payload message looks like this
    <AggregateFn action="SQL_QUERY">
      <access>SELECT sum(Weight) FROM KmFuelTrace WHERE resourceno = '$resno$' AND startdate = '$sdate1$'</access>
    - <key>
      <resno compareOperation="EQ">CHILLED_02</resno>
      <sdate1 compareOperation="LT">06/08/2007</sdate1>
       </key>
      </AggregateFn>
    I am getting a error "Data type mismatch in criteria expression" .
    I have defined the datatypes correctly with DateTrans function . I think its the problem with access statement.
    How to give the selection criteria for non-text fields. (can i use same quotes and dollar combination for date field too) . Or is there any other mistake in the xml structure

    Aarthi,
    Try the following
    <AggregateFn action="SQL_QUERY">
    <access>SELECT sum(Weight) FROM KmFuelTrace WHERE resourceno = '$resno$' AND startdate = $sdate1$</access>
    - <key>
    <resno compareOperation="EQ">CHILLED_02</resno>
    <sdate1 compareOperation="LT">06/08/2007</sdate1>
    </key>
    </AggregateFn>
    Also check what us the date format that database uses and give the similar format.
    Regards,
    Sudharshan N A
    Message was edited by:
            Sudharshan Aravamudan

  • Issue with Select Query in the Delivery userexit USEREXIT_SAVE_DOCUMENT

    Hi All,
    I am facing a strang issue with delivery userexit
    1) I have a delivery user exit MV50AFZ1 - USEREXIT_SAVE_DOCUMENT.
    2) In this user exit. I have written a select query as shown below
    *Get the already delivered data
        SELECT vbeln
               vgbel
               vgpos
               erdat
               erzet
               lfimg
          FROM lips
          INTO TABLE t_lips
           FOR ALL ENTRIES IN t_xlips_reference
         WHERE vgbel EQ t_xlips_reference-vgbel
           AND vgpos EQ t_xlips_reference-vgpos.
        IF sy-subrc EQ 0.
        ENDIF.
    3) The use of the above select query is to find out if there is any delivery that has already been created for the reference slaes order for which the current delivery is being created.
    4) The issue here is that for the FIRST DELIVERY, this select query should fail becuase there is no delivery created earlier and LIPS table would not have data. But, I am seeing some data getting populated in the internal table. The data that I am seeing in the internal table is the data of XLIPS which is nothing but the one that is about to get saved in the database after finishing this userexit.
    5) STRANGE Point is that this is working fine in case if I create delivery using the transaction VL01N. But, if I create delivery using VL10A program I am facing this issue.
    << Removed >>
    Thanks,
    Babu Kilari
    Edited by: Rob Burbank on Jun 16, 2010 4:22 PM

    Then why don't you add
    AND vbeln NE likp-vbeln

  • RRI Jump Query opens the receiver query in standard Template??

    Hi,
    Few questions from me (Note I have searched the forum database for answers but didnt get a convincing answer)
    1) How can I use 1 web custom built template for 2 different queries?
    2) I have created the sender receiver setting for the Jump queries. The problem that I am facing is that the sender query uses the custom built web template but when I use GOTO the receiver query instead of using the custome template it executes in standard webtemplate. Kindly suggest how can I open the receiver query in the custom built web template after GOTO function.
    Thanks for all your help in advance..
    - Amit

    Hi SS,
    I agree to the statement that RRI uses link to Query but if we setup the custom web template for that jump query in WAD....it will never open in that template via RRI ???
    That very disappointing discovery for me !!!
    Any other possiblity to make this work????
    What if I have the sender and receiver query web template(custom) same???.is it possbile to use the same template for these two template even after jump ???
    Regards

  • Select query after the submit stmt

    Hi,
      Have used the submit stmt as
    " SUBMIT pgm name WITH SELECTION-TABLE rspar_tab
    EXPORTING LIST TO MEMORY
    AND RETURN."
    Now the o/p generated is saved in the memory.In the report which is generated I have to fetch only 2 values based on one field as criteria..How to write the select query.

    hi,
      after the submit statement use the LIST_FROM_MEMORY
    function module...this function module loads the list from ABAP memory to an internal table of row type ABAPLIST...
    after the data has been saved in an internal table u can do selection on the basis of the field...
    Edited by: siddharth kumar on Oct 10, 2008 2:01 PM

  • Select Query after the Event "GET  node "

    Hi,
    My requirements is I am calling get object event in my report and preparing an internal table in the get event, after this i need to write a select query based on this internal table..
    i want to avoid select query inside get event, my problem is to end the GET event and write a select query..
    How can i do that..
    can i write it in the end-of-selection.( i don't think so)
    it looks like this.
    start-of-selection.
    get objec.
    " Internal table preparation
    ????????event name needed??????????
    select query.....
    please suggest.

    END-OF-SELECTION.
    Effect
    This statement defines an event block, whose event is raised by the ABAP-runtime environment during the calling of an executable program , if the logical database, with which the program is linked, has completely finished its work.
    Moderator message - Sandeep - if you have to cut and paste from the help, please note it as such.
    Edited by: Rob Burbank on Nov 26, 2009 12:42 PM

  • SELECT query in a sender jdbc comm channel

    Hi experts,
    I would like to access a table in a database and select some rows from there but from a specific date onwards. I mean, i want to retrieve only the rows from, lets say, table.date = 2008-04-05 on.
    So i specified somthing like:
    *SELECT * FROM table WHERE date >= to_date(‘2008-04-05’) and status ='0'*
    UPDATE table SET status='1' WHERE date >= to_date(‘2008-04-05’) and status ='0'
    BUT this is throwing following error message:
    The JDBC driver returned the following error message: 'java.sql.SQLException: ORA-00911: invalid character '. For details, contact your database server vendor.
    Could you please provide some support in order to achieve this?
    Thanks in advance and best regards,
    David

    Hi there,
    I tried again without using the 'to_date' function but still doesnt work.
    I have no access to the database so i asked the DB team to make some testing there. They say the date format in the DB is 'dd-mm-YYYY' but XI receives 'YYYY-mm-dd' via jdbc adapter!!!!
    So, at first i typed 'YYYY-mm-dd' in the query and this was the result:
    Database-level error reported by JDBC driver while executing statement 'SELECT * FROM albaranes,lineas WHERE albaranes.albaran = lineas.albaran and albaranes.fecha_albaran >= ‘2004-06-19’ and albaranes.sap_status ='3''. The JDBC driver returned the following error message: 'java.sql.SQLException: ORA-00911: invalid character '. For details, contact your database server vendor.
    and shortly afterwards i used 'dd-mm-YYYY' and this is what i got:
    Database-level error reported by JDBC driver while executing statement 'SELECT * FROM albaranes,lineas WHERE albaranes.albaran = lineas.albaran and albaranes.fecha_albaran >= '19-06-2004' and albaranes.sap_status ='3''. The JDBC driver returned the following error message: 'java.sql.SQLException: ORA-01843: not a valid month '. For details, contact your database server vendor.
    sap_status field is of string type so this is not the point, i think.
    Could you please advice?
    Best regards,
    David
    Edited by: Domingo Jimenez Navarrete on May 5, 2008 12:18 PM

  • Want Batch mode in the Receiver  JDBC adapter

    Hi,
      My scenario is  File  to JDBC .  from the source file I'm getting  20 records for file. after processing by XI while inserting the records into database level but due to some problem  some records are not inserting.. suppose first 5 records got successfully inserted. but 6th record  due to unique contarin problem that was failed. but  due to this problem remaing records are also not inserting from the 6th record onwards it was not inserting any more records . 
       But i want to process all the Records or If any error is there in those records i want to fail all the records. I dont want any partial posting of the data.
    Plesae suggest me some solution for this.
    Regards
    Jain

    Hi Joel,
        Already i have selected that Batch Mode in Advanced tab.  my  transport protocol is JDBC 2.0 .
    And my SQL query is only INSERT  . in the mapping i have mapped action tag to  INSERT Command  for  inserting the rows... 
         still  my SQL query is inserting first 5 records only out of 20 records ... if the sixth record contain any problem  the process has been terminating .
       Please suggets me some solution for avoiding those problems. if any error is there then i want to fail teh complete message otherwise process all the records.   I dont want any partial posting of the file.
    Regards
    Jain

  • Case expression error with a select query in the condition

    Consider the two query below:
    1. The first one use a case expression :
    select case when 3 > (select 1 from dual)*2 then 1 else 0 end from dual
    2. The equivalent with a decode expression:
    select
    decode(sign(3-(select 1 from dual)*2),1,1,0) from dual
    The first query return an ORA-00905 error but not the second one. It seems that the arithmetic operation (select 1 from dual)*2 cause the error. The folowing query doesn't return this error:
    select case when 3 > (select 2 from dual) then 1 else 0 end from dual
    I run the test with Oracle 8.1.7.3 Enterprise Edition. Is it a known bug ?
    Thomas

    ora8174>select case when 3 > (select 1 from dual)*2 then 1 else 0 end from dual;
    select case when 3 > (select 1 from dual)*2 then 1 else 0 end from dual
    ERROR at line 1:
    ORA-00905: missing keyword
    ora8174>select case when 3 > cast((select 1 from dual)*2 as number) then 1 else 0 end from dual;
    CASEWHEN3>CAST((SELECT1FROMDUAL)*2ASNUMBER)THEN1ELSE0END
                                                           1
    1 row selected.
    ora8174>select case when 3 > to_number((select 1 from dual)*2) then 1 else 0 end from dual;
    CASEWHEN3>TO_NUMBER((SELECT1FROMDUAL)*2)THEN1ELSE0END
                                                        1
    1 row selected.
    ora8174>@connect
    Connected.
    ora9204>select case when 3 > (select 1 from dual)*2 then 1 else 0 end from dual;
    CASEWHEN3>(SELECT1FROMDUAL)*2THEN1ELSE0END
                                             1
    1 row selected.

  • Displaying different no. of  records for a select Query for the same dbuser

    Hi,
    While querying from my machine after connecting to custom schema it is displaying 3000 rows.
    When the same query was executed from different machine it is displaying just 31 records.
    1. Connect as xxyy user and executed the below command
    select count(*) from xxyy. XXYY_APAR_SUPP_CUST_MAST_V.
    output is showing some 3000 records
    2. Connect as xxto user and executed the below commands for a specific user and specific machine
    select count(*) from xxyy. XXYY_APAR_SUPP_CUST_MAST_V.
    output is showing just 31 records
    Please help...!!

    Hi,
    I hope you would have resolved the problem, if not, next step could be to check the TNS on both machines because now i suspect that your TNS on other machine points to some idfferent database.
    What do you mean by following
    2. Connect as xxto user and executed the below commands for a specific user and specific machineSo you connect with different users? If yes, then from both machines, if you connect with the same user, is result same?
    When the same query was executed from different machine it is displaying just 31 records.Please paste the TNs entry for the database from both of your client machines from where you run the query.
    Salman

  • Error in the receiver JDBC

    Hi ,
      Iam sending the message using the test message tab in the RWB.Iam getting the Error message which is given below :
    2006-06-19 21:16:16 Success The message was successfully received by the messaging system. Profile: XI URL: http://XXXXXX/MessagingSystem/receive/AFW/XI
    2006-06-19 21:16:16 Success Using connection AFW. Trying to put the message into the request queue.
    2006-06-19 21:16:16 Success Message successfully put into the queue.
    2006-06-19 21:16:16 Success The message was successfully retrieved from the request queue.
    2006-06-19 21:16:16 Success The message status set to DLNG.
    2006-06-19 21:16:16 Error Unable to find channel ID
    2006-06-19 21:16:16 Error Delivery of the message to the application using connection AFW failed, due to: Couldn't find delivery channel for message: 5f5565f0-XXXXX. Setting message to status failed.
    2006-06-19 21:16:16 Error The message status set to FAIL.
    2006-06-19 21:16:16 Error Returning synchronous error message to calling application: Couldn't find delivery channel for message: 5f5565f0-fffaXXXXX.
    Can any one throw some light on the above error.
    It worked fine when we are triggering the message thru the normal SAP Proxy execution.
    Regards,
    Kittu.
    Message was edited by: kittu chowdary
    Message was edited by: kittu chowdary

    Hi Kittu,
    First check your Pipeline URL in SLD.
    Business System -><your Integration Server -> Pipe Line URL
    It should be
    http://Server:port/sap/xi/engine?type=entry
    And here port should be http port(8xxx).
    Is your scenario is Synchronous ?
    Hope this helps,
    Regards,
    Moorthy

Maybe you are looking for

  • Hooking up Airport Express for the first time

    Hi - Like many others, I just can't seem to figure out how to hook up my AirPort Express (802.11n). Here is how I am currently set up ... In the basement I have a Mac Mini hooked up to an ActionTec GT701-WG wireless router (from Qwest), but I am usua

  • Hard drive corrupted, recovery software threw iPhoto info files everywhere

    Ok, so my hard drive got corrupted, and I got some of the data off of it, but not all. I think there is a lot of iPhoto files scattered about the folders in a "Lost Folder(s)," which the recovery software decided to do. (I used Stellar Phoenix) I wat

  • ITunes store error -37 (long filename?)

    I purchased 54 songs (Stravinsky, actually) and one of them would not and will not download, giving an error of "stopped, err = -37". According to the store support e-mail response, it may have something to do with long filenames. They cited this: ht

  • Camera Calibration Profiles do not show in Develop Module LR5 / Windows 7

    I have selected three specific camera profiles (Nikon D300, Nikon D700 and Canon G12) and placed them into: c:\Users\{me}\AppData\Roaming\Adobe\CameraRaw\CameraProfiles\{Nikon D800} I restarted Lightroom 5 and viewed a RAW photo (not jpg or tif). But

  • OSX Open/Finder Window Grows

    Not sure if I am the only one having this problem put I do have it on two MBPrs, a 15" (early 2013) and a 13" (early 2014) both running version OSX 10.10.2. My finder window when selecting the open file or save a file in various applications (Adobe C