Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
SQL stored procedure returns empty recordset
Message
De
06/10/2005 11:41:11
 
 
À
Tous
Information générale
Forum:
Visual FoxPro
Catégorie:
Client/serveur
Titre:
SQL stored procedure returns empty recordset
Versions des environnements
Visual FoxPro:
VFP 9
OS:
Windows XP SP2
Network:
Windows 2003 Server
Database:
MS SQL Server
Divers
Thread ID:
01056794
Message ID:
01056794
Vues:
55
Stored procedure
CREATE PROCEDURE usp_test 
	@Number	INT
AS
SELECT @Number + 3
GO
is being called from VFP the following way
loRS = oData.oConn.Execute("usp_Test 3")
?loRS.Fields(0).Value	&&returns 6
Works fine.
oData.oConn is an ADODB.Connection

Stored procedure
CREATE PROCEDURE usp_dsp_TooLate2AddInvoice
	@Drv_CD	CHAR(8)
AS
DECLARE @TooLate		BIT
DECLARE @RecordsCheckedOut	INT
DECLARE @LatestCheckOut		DATETIME
SELECT @RecordsCheckedOut = COUNT(*)
	FROM dspCOutH
	WHERE Driver_CD = @Drv_CD AND Out_Dt IS NOT NULL
IF @RecordsCheckedOut = 0
	SET @TooLate = 0
ELSE
	BEGIN
	SELECT @LatestCheckOut = MAX(Out_DT)
		FROM dspCOutH
		WHERE Driver_CD = @Drv_CD
	IF DATEADD(ss, 300, @LatestCheckOut) > GETDATE()
		SET @TooLate = 0
	ELSE
		SET @TooLate = 1
	END
SELECT @TooLate
GO
is being called from VFP the same way
loRS = oData.oConn.Execute("usp_dsp_TooLate2AddInvoice '1001'")
?loRS.Fields(0).Value    &error
gives error "Member FIELDS does not evaluate to an object".
What is wrong with second function?

Second question. What would be the syntax to pass variable instead of literal?
lcDriver = '1001'
loRS = oData.Call_SP("usp_dsp_TooLate2AddInvoice lcDriver")
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform