Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
SQL Insert fields with a ' in them
Message
 
 
À
02/06/2015 08:38:23
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Versions des environnements
Visual FoxPro:
VFP 9 SP2
OS:
Windows Server 2012
Network:
Windows 2008 Server
Database:
MS SQL Server
Application:
Desktop
Divers
Thread ID:
01620334
Message ID:
01620496
Vues:
44
>>Gregory provided you with the correct way of using parameters. One possible gotcha - check out the types of the parameters, quite often VFP sends them wrongly (say, float for numeric, etc.) In those cases you can use CAST to correct type inside the ?mproperty, e.g.
>>
>>'cast(?mProperty as NUMERIC(17,0))'
>
>I do not think that is applicable here
>
>This scenario is to fill a remote view or cursoradapter. In this case the insert goes into the vfp 'cursor'
>
>As to quite often VFP sends them wrongly (say, float for numeric, etc.)
>I have seen this with the sql profiler - but again this is not related to these parameters but to his insert statement

I know for a fact that when we were sending values as parameters for the columns which are defined as NUMERIC(17,0) in SQL Server, VFP was sending these parameters as float (as I observed it using SQL Server profiler). So, I added the 'CAST(?myParam as NUMERIC(17,0))' so SQL Server will always treat these parameters in a correct way. Without that it was implicit conversion which could have been costly.
If it's not broken, fix it until it is.


My Blog
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform