Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
SQL Server problem
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
Base de données, Tables, Vues, Index et syntaxe SQL
Divers
Thread ID:
01194131
Message ID:
01194171
Vues:
11
>>OK Here's my solution. Thanks to all of you who contributed.
>>Borislav - I don't see the need for your form of ?m.lcPermID since lcPermID is a local variable and the select is called only once. Perhaps I am missing something.
>>
>>lcSQL = "select * " + ;
>>	"from TRPSurvey" + "..exported " + ;
>>	"where ltrim(rtrim(PermID)) = " + lcPermID
>>
>>IF sqlexec(m.lnHandle,lcSQL,"crsImport") < 0
>>   AERROR(laError)
>>   MessageBox(laError[1,2])
>>ENDIF
>>
>
>How does it work? I do not see lcPermID surrounded by single quote.

Naomi,
SQL Server sometimes do implicit conversion to the type it expected. But as I said to Don this is asking for trouble, sometimes it will works, sometimes it wont, if you have SQL Server you could try:
DECLARE @Temp TABLE (descr varchar(200))
INSERT INTO @temp values ('1234')
SELECT * from @Temp WHERE descr = 1234
BUT:
DECLARE @Temp TABLE (descr varchar(200))
INSERT INTO @temp values ('asdasdasd')
SELECT * from @Temp WHERE descr = 1234
BOOOOOOOM
Against Stupidity the Gods themselves Contend in Vain - Johann Christoph Friedrich von Schiller
The only thing normal about database guys is their tables.
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform