So I've been wanting to rewrite stored procedures from markup to cfscript. I've done it so I'm posting an example for other newbies out there in the world to see.

public query function testFunction(var1,var2)

{

sp = new storedproc();

sp.setDatasource(THIS.DSN);

sp.setProcedure("MyGroovySQLSproc");

sp.addParam(cfsqltype="cf_sql_integer", type="in",value=arguments.var1);

sp.addParam(cfsqltype="cf_sql_integer",type="in",value=arguments.var2);

sp.addProcResult(name="rs1",resultset=1);

result = sp.execute();

return result.GetProcResultSets(1).rs1;

}

That's it. I'm not sure what is the benefit. It seems that they could have made a shorter way of doing this. Maybe that's another post.