on 08-25-2010 3:27 AM
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
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
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
87 | |
10 | |
10 | |
10 | |
7 | |
6 | |
6 | |
5 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.