Information générale
Catégorie:
Base de données, Tables, Vues, Index et syntaxe SQL
>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
Voir le fil de ce thread
Voir le fil de ce thread à partir de ce message seulement
Voir tous les messages de ce thread
Voir tous les messages de ce thread à partir de ce message seulement