cancel
Showing results for 
Search instead for 
Did you mean: 

How to write a query against a SQL or Oracle database to read the data.

Former Member
0 Kudos

Just want to ask, how to write a query against a SQL or Oracle database to read the data from it and write the read to file.

Accepted Solutions (0)

Answers (3)

Answers (3)

Former Member
0 Kudos

If you want to write a direct SQL query -

Message Type Structure - MT_SQL  - Statement - dbTable(1..1) - action (attribute) - access .

Pass "SQL_QUERY" to action and the sql string to access.

The response structure should be the same fields as in the select query (case sensitive)

If you want to pass an arbitrary update query use "SQL_DML" to action attribute.

Former Member
0 Kudos

Can you please provide some examples

justin_santhanam
Active Contributor
0 Kudos

Naveed,

Please see the below example:

Define your Data Type/Message Type like the below formats. Just take a look at the highlighted segment. You can name it as XYZ on the request message, but the response message will come like XYZ_response. Also they are all case- sensitive. Also when you define the response structure, just make sure you are defining the element names exactly the same case (lower/upper or mixed case) as you have written in the query.

Hope this helps, if not let us know!

Thanks!

iaki_vila
Active Contributor
0 Kudos

Hi Naveed,

You have in this link a step by step example: SAPTechnical.COM - Implementation of SOAP to JDBC Synchronous scenario, you only need to change the UPDATE format by the SELECT format pointed out by Maheswarareddy.

Regards.

maheswarareddykonda
Active Contributor
0 Kudos

here you need to check this basics blaogs about JDBC server, here explained about all, u just check this Configuring the JDBC Adapter - Advanced Adapter Engine - SAP Library

Coming to write the SQL statements , depends on actions(Select,update,delete) we suppose to write the Query to execute.