I'm running Microsoft SQL Server 6.5 and using VC++ 5.0
I have a SQL Server stored procedure that has no input or
output parameters, but returns a value from executing a query. There are two variables inside the procedure that basically retrieve a value from a table and increment it by one, updates the table and returns the new value.
I am executing the stored procedure using DB-Library commands like this.
retcode = dbrpcinit(dbproc,"get_shipment_num",0);
retcode = dbrpcsend(dbproc);
retcode = dbsqlok(dbproc);
The call to dbsqlok fails, which indicates I probably have a syntax error. It doesn't seem like I should need any dbrpcparam calls, since I have no parameters, but I have tried that way also. No success yet.
I'd be really happy to hear from someone that has done this before and can tell me how to make it work.