Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Inserting records to SQL Server
Message
De
31/10/2001 11:41:27
 
 
À
31/10/2001 11:15:25
Sergio Ortiz
Tek Services Group, Llc
Hollywood, Floride, États-Unis
Information générale
Forum:
Visual FoxPro
Catégorie:
Base de données, Tables, Vues, Index et syntaxe SQL
Divers
Thread ID:
00574760
Message ID:
00575687
Vues:
33
>Crescencio, thanks again for your help!!!.
>
>I tried the following code and it worked!
>
>**********************************************************
>nRes = SQLExec(nHan, "INSERT INTO jeinterface (batch_skey);
> Values(" + lcBatchSkey + ") ")
>**********************************************************
>
>But when the lcBatchSkey is empty I ge an SQLExec failure.
>(the field type in the SQL Server is varchar(50)).
>
>Also when looking at the records in the SQLServer the values are not
>left padded with '0'. (the values in the VFP table for the batch_skey
>are left padded with 0s ex: '0000000000000001')
>
>Thanks,
>Sergio

That is easily solved by not running an insert when the value is empty. Or if you still need it (can't think of a reason why, unless there are more fields) you can always put it to all zeroes. For padding the lcBatch variable with leading zeroes look at PADL() function.HTH
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform