Skip to Content
0
Former Member
Jun 09, 2009 at 12:50 PM

Calling a Stored Procedure with Parameter using an UDF

158 Views

Hi All,

I have a requirement where I need to use database lookup. In that I am calling the Stored Procedure using UDF. For example sp_flow ., for this I have to pass<INTID> and <USDERID> to get the response.

I am using the below code to excute this.

*************************************

Channel channel = null;

Map rowMap = null;

DataBaseAccessor accessor = null;

DataBaseResult resultSet = null;

String Query = null;

//Query ="EXECUTE dbo.sp_flow <INTID> <USERID>;

Query = "EXECUTE dbo.sp_flow \'304\' , \'shankar\' " ;

try{

//Determine a channel, as created in the Configuration

channel =

LookupService.getChanne"BS_XXX","CC_XXX_JDBC_Rcv");

//Get a system accessor for the channel. As the call is being made to an

DB, an DatabaseAccessor is obtained.

accessor = LookupService.getDataBaseAccessor(channel);

//Execute Query and get the values in resultset

resultSet = accessor.execute(Query);

for(Iterator rows = resultSet.getRows();rows.hasNext();){

rowMap = (Map)rows.next();

result.addValue((String)rowMap.get("FLOW_ID"));

}

I am getting the error "Error when calling an adapter by using the communication channel CC_NWLS_TLA_JDBC_Rcv (Party: , Service: BS_MICROSOFT_SQLWLS20DEV_D, Object ID: d30aace599de3cd69548bf145d0724b7) XI AF API call failed. Module exception: (No information available). Cause Exception: 'Error processing request in sax parser: Error when executing statement for table/stored proc. 'table' (structure 'statement'): com.microsoft.sqlserver.jdbc.SQLServerException: The statement did not return a result set."

let me know how do this.

Regards

shankar

Edited by: Shankar on Jun 9, 2009 2:51 PM

Edited by: Shankar on Jun 9, 2009 3:02 PM