Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
SQL Update
Message
 
 
À
07/09/2005 14:46:06
Fred Wood
Madera Systems Consulting
Mill Valley, Californie, États-Unis
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Titre:
Divers
Thread ID:
01047453
Message ID:
01047459
Vues:
7
You can make you code much more readable and maintanable by using TEXTMERGE.
TEXT TO lcSQL TEXTMERGE NOSHOW PRETEXT 7
UPDATE icitem SET carloc = ?m.carloc
  WHERE item = '<<lc_item>>'
ENDTEXT
lnRetVal = SQLEXEC(ln_connection, lcSQL)
>I am having a problem with the following code:
>
>
>m.carloc = ThisForm.carousel + ;
>           PADL(LTRIM(STR(ThisForm.bin, 2, 0)), 2, "0") + ;
>           PADL(LTRIM(STR(ThisForm.shelf, 2, 0)), 2, "0") + ;
>           ThisForm.loc
>
>lc_update = [carloc = ?m.carloc]
>lc_item   = ThisForm.citem
>
>*-- Update ICITEM table  	
>lcSQL = [UPDATE icitem SET ] + lc_update + [ WHERE item = ] + lc_item
>lnRetVal = SQLEXEC(ln_connection, lcSQL)
>
>
>m.carloc is a character type variable and the carloc field in icitem is set as a character field. When the update is attempted AERROR() says that the problem is "Error converting data type varchar to numeric."
>
>I don't understand why any conversion would be necessary and why numberic?
you
--sb--
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform