Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Syntax to read a sql server used defined function in VFP
Message
De
07/04/2010 09:23:20
 
 
Information générale
Forum:
Visual FoxPro
Catégorie:
Client/serveur
Versions des environnements
Visual FoxPro:
VFP 9 SP2
OS:
Windows 7
Divers
Thread ID:
01459132
Message ID:
01459142
Vues:
49
Thank you Sergey.

It worked.

Joaquim


>Quick and dirty
>lnResult = Sqlexec(m.hConn, "SELECT dbo.ReadValue(?m.paramValue) AS value2", "crsResult")
>IF lnResult < 0
>  * Error, use AERROR()
>  ....
>ENDIF
>m.value2 = crsResult.value2
>
>
>>
>>Can anyone help with the syntax to read a value from a sql server function?
>>
>>Problem:
>>
>>i have a Sql server function like this;
>>
>>
>>CREATE FUNCTION ReadValue
>>(
>>	@Key char(10)
>>)
>>RETURNS decimal(16,3)
>>AS
>>BEGIN
>>  DECLARE @Value decimal(16,3);
>>  select @Value = field from table where key = @key;
>>  RETURN @Value;
>>END
>>GO
>>
>>
>>I can get the value in sql server using the following expression:
>>
>>print readValue('1234567890');
>>
>>
>>No i want to use the returned value fom this function in VFP.
>>It should be something like this:
>>
>>m.paramValue = "1234567890"
>>m.hConn = GetSQLConnection()
>>m.value2 = Sqlexec(m.hConn, "ReadValue(@Key = ?m.paramValue)")
>>wait window m.value2
>>
>>
>>Can anyone help me with this?
>>
>>TIA,
>>Joaquim
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform