cancel
Showing results for 
Search instead for 
Did you mean: 

JDBC receiver adapter

Former Member
0 Kudos

Hi,

I am trying to count number or columns in a table using receiver JDBC adapter

I found Bhavesh's web blog which seemed to be helpful but not completely.

/people/bhavesh.kantilal/blog/2006/07/03/jdbc-receiver-adapter--synchronous-select-150-step-by-step

In the above blog they used select statement. How do I achieve my requirement using JDBC receiver adpater and count the number of rows in the table?

Any other blogs that anybody is aware of?

Thanks in advance

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi Nikhil

May be you can use the SQL_QUERY option for the action attribute in the receiver data type (JDBC end) and accomplish this task. Find below the indicative data type structure, for this approach

<DTI_JDBC_COUNT_REQUEST>

<STATEMENT>

<COUNT_ACTION action="SQL_QUERY">

<access>select count(*) Record_Count from tablename</access>

</COUNT_ACTION>

</STATEMENT>

<DTI_JDBC_COUNT_REQUEST>

<DTI_JDBC_COUNT_RESPONSE>

<STATEMENT_response>

<row>

<Record_Count></Record_Count>

</row>

</STATEMENT_response>

<DTI_JDBC_COUNT_RESPONSE>

Note: I have directly given the query and value for action attribure here. In reality you have to provide these at the time of message mapping.

Regards

Sriram

Answers (2)

Answers (2)

dharamveer_gaur2
Active Contributor
0 Kudos

Hi

You can use Stored procedure to get response count record those are part of your select query.

Check one more similar blog /people/luis.melgar/blog/2008/05/13/synchronous-soap-to-jdbc--end-to-end-walkthrough

former_member204873
Contributor
0 Kudos

Try to create an Stored Procedure and have an select query passing table_name as input:

For checking number of columns:

SELECT count(*) as 'Alias name' FROM INFORMATION_SCHEMA.COLUMNS where

table_name='table name'

For checking number of rows:

SELECT COUNT(*) as 'Alias name' FROM table_name

Call Stored Procedure in the Receiver JDBC channel.

http://help.sap.com/saphelp_nw04/helpdata/en/2e/96fd3f2d14e869e10000000a155106/frameset.htm