Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Insert data via SQLexec
Message
 
Information générale
Forum:
Visual FoxPro
Catégorie:
Base de données, Tables, Vues, Index et syntaxe SQL
Versions des environnements
Visual FoxPro:
VFP 9 SP2
Divers
Thread ID:
01521368
Message ID:
01521389
Vues:
49
>I managed to do as below:
>
>
>scatter memvar
>test = SQLEXEC(m.lnHandle, "INSERT INTO correios (nome, rua);
>       VALUES (m.nome,m.rua)")
>
>= MESSAGEBOX(test)
>
>
>It returns  -1
>
>
>Using '  '  it seems to work:
>
><pre>
>scatter memvar
>test = SQLEXEC(m.lnHandle, "INSERT INTO correios (nome, rua);
>       VALUES ('m.nome', 'm.rua')")
>
>= MESSAGEBOX(test)
>
>
>It returns  + 1
>
>
>However it replaces literal value  'm.nome' and 'm.rua'  instead of value stored in variable
>
>
>
>
>How can I track this error ?
>
Use
scatter memvar
test = SQLEXEC(m.lnHandle, "INSERT INTO correios (nome, rua)  VALUES (?m.nome,?m.rua)")
This will correctly insert your information using variables as parameters.
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