Skip to Content
0
Former Member
Jun 09, 2009 at 01:14 PM

Calling a Stored Procudre from UDF by passing parameters

43 Views

Hi All,

In UDF I need to call a stored procedure by

example:

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"));

}

Suggest me how to statement Query=Query = "EXECUTE dbo.sp_flow \'304\' , \'shankar\' " ; is correct or not !!

Regards

Shankar