>Select sum(qty*price) from JobItems Into Array laTotal > >return Nvl(laTotal, 0) >>
* Create temp stored procedure with OUTPUT parameter and call it. SQLEXEC(m.lnConn, "CREATE PROCEDURE #MyProc @outparam int OUTPUT AS; SELECT @outparam=100") SQLEXEC(m.lnConn, "exec #myProc ?@lnOutput") ? m.lnOutputSo, if you don't want to use the cursor, you can use output parameter to return your result. I think using one record cursor is fine and simple.