General information
Category:
Databases,Tables, Views, Indexing and SQL syntax
Title:
How do I run an SQL Stored Procedure
Environment versions
Network:
Windows 2000 Server
I want to run a Stored Procedure in SQL 2000, but I can NOT seem to get the return values into memory variables
To run it in Query Analyzer I use:
declare @_result int
declare @_rows_created int
declare @_rows_updated int
exec @_result = sp_UPDATE_WIRES_WORK_ORDERS_TABLE
@_rows_created output,
@_rows_updated output
print 'Rows created: ' + cast(@_rows_created as varchar(10))
print 'Rows updated: ' + cast(@_rows_updated as varchar(10))
print 'Return value: ' + cast(@_result as varchar(10))
In FoxPro I can easily run the SP but NO RETURN values:
=SQLEXEC(hsql, "sp_UPDATE_WIRES_WORK_ORDERS_TABLE ")
I tried:
Store Int(99) To mrowscreated,mrowsupdated,mresult
=SQLEXEC(hsql, ="(?m.mresult = CALL sp_EXPORT_LINE_ITEMS_TO_WIRES_TEST(output ?m.mrowscreated, ?m.mrowsupdated))"
? mresult
? mrowscreated
? mrowsupdated
The values are always the 99 it was originally set at and not the values from Stored Procedure
hsql is an SQL connection made with SQLSTRINGCONNECT()
Next
Reply
View the map of this thread
View the map of this thread starting from this message only
View all messages of this thread
View all messages of this thread starting from this message only