[Zope-DB] recordset from stored procedure with mxODBC DA

Wade Leftwich wade@okaynetwork.com
Sun, 15 Dec 2002 15:12:10 -0500


Hi

I have a stored proc in SQL 2000 that looks like this:

create proc addStudent as
insert into student (lastname) values ('');
select @@IDENTITY as studentid

When I use it from mxODBC it works as expected, creating a new record and 
returning its id.

However, when I create a ZSQL method whose body is simply "exec addStudent", 
it inserts a new record but returns no recordset.

How can I get that return value?

My alternative is to run to separate zSQL queries, one to do the insert and 
another to get the @@IDENTITY. But using the stored procedure seems much 
cleaner, and I would like to be able to use ZSQL to run more complicated 
stored procs as well.

Any help appreciated.

Wade Leftwich
Ithaca, NY