Information générale
Titre:
ORACLE AND SQLEXEC() Part III
If you run this parameterized view without variable defined, VFP will ask you for the value of variable. If you respond with '1 ' (exactly 10 charactes long) the query returns 1 record. If however you predefine the value of variable = '1 ' (same 10 characters), THE QUERY RETURNS ZERO RECORDS! Remote views constructed and saved in a VFP database exhibit this same behavior.
The queries seem to run OK if the value of variable has NO TRAILING SPACES!
The only workaround I have found is to dynamically construct the SQL statement just prior to execution like this:
"SELECT * FROM MyTable WHERE PrimKey = '" + padr(variable, 10) + "'"
(WHAT A BOTHER!)
Anybody have an answer to my problem or a better workaround?
COMPLAINT DEPT: Also for some reason a parameterized SQL statement like "SELECT * FROM MyTable WHERE PrimKey = ?variable" works unchanged on both FoxPro and remote data (A BIG PLUS!), but a parameterized UPDA
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