cancel
Showing results for 
Search instead for 
Did you mean: 

How to select a from DB having condition?

Former Member
0 Kudos

Hi,

My Sceneriois Proxy-to-JDBC Synchrous. Senderis sendingidto JDBC and JDBC need to select the data based on this id  and send it back to proxy.

Select A,B,C,Sales_id, Sales_Date where Sales_id=id and Sales_Date= between today and Today-20 is the data we need to select from JDBC.

I have created recieveras follows:

Root

   <Statement>

       <dbTableName>

        Action

        Table

        <Access>

         A

         B

         C

         Sales_ID

         Sales_Date

        <Key1>

          Sales_ID

         

But i am a little bit confused about Sales_Date field and its Condition, Where to mantian in structure and How to pass condition.








    

          

                           

Accepted Solutions (0)

Answers (2)

Answers (2)

Former Member
0 Kudos

Hi Veera,

You can handle your requirement in the below ways

1)Using SQL_QUERY -->you can directly give your query as an input (Make use of placeholders to pass values dynamically to SQL query )

Defining an SQL_QUERY Statement - Advanced Adapter Engine - SAP Library

2)As above said you can go for stored procedure .

NOTE:Required logic need to implement in d/b by creating a stored procedure

Document Formats for the Receiver JDBC Adapter - SAP XI: Runtime - SAP Library

Regards

Venkat

manoj_khavatkopp
Active Contributor
0 Kudos

Hi Veera,

When you have condition like 'between' , 'group by ' etc ..better handle by stored procedure .Where the conditions are all mentioned in stored procedure and u need to call that stored procedure with required parameters.

Br,

Manoj

Former Member
0 Kudos

Hi manoj,

  We are  selecting the data by query only, we are not using stored procedures.

regards,

Veera

former_member184720
Active Contributor
0 Kudos

Have you gone through the option 1 provided by Venkat, Do you still have any questions on that approach?