Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
How do I run an SQL Stored Procedure
Message
De
04/02/2005 00:19:32
Joel Hokanson
Services Integration Group
Bellaire, Texas, États-Unis
 
 
À
Tous
Information générale
Forum:
Visual FoxPro
Catégorie:
Base de données, Tables, Vues, Index et syntaxe SQL
Titre:
How do I run an SQL Stored Procedure
Versions des environnements
Visual FoxPro:
VFP 8 SP1
OS:
Windows 2000 SP4
Network:
Windows 2000 Server
Database:
MS SQL Server
Divers
Thread ID:
00983745
Message ID:
00983745
Vues:
44
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()
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform