Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Insert data via SQLexec
Message
 
General information
Forum:
Visual FoxPro
Category:
Databases,Tables, Views, Indexing and SQL syntax
Environment versions
Visual FoxPro:
VFP 9 SP2
Miscellaneous
Thread ID:
01521368
Message ID:
01521389
Views:
48
>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
Previous
Reply
Map
View

Click here to load this message in the networking platform