Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
How do I run an SQL Stored Procedure
Message
From
04/02/2005 00:19:32
Joel Hokanson
Services Integration Group
Bellaire, Texas, United States
 
 
To
All
General information
Forum:
Visual FoxPro
Category:
Databases,Tables, Views, Indexing and SQL syntax
Title:
How do I run an SQL Stored Procedure
Environment versions
Visual FoxPro:
VFP 8 SP1
OS:
Windows 2000 SP4
Network:
Windows 2000 Server
Database:
MS SQL Server
Miscellaneous
Thread ID:
00983745
Message ID:
00983745
Views:
43
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
Map
View

Click here to load this message in the networking platform