Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
A simple error...
Message
 
 
To
17/06/2003 18:19:07
General information
Forum:
Visual FoxPro
Category:
Databases,Tables, Views, Indexing and SQL syntax
Miscellaneous
Thread ID:
00800984
Message ID:
00800987
Views:
29
I would use SQLEXEC parameters or TEXTMERGE
ln_next = ln_last + 1
myresult = SQLEXEC(1,'Insert INTO phone (phon_phoneid, phon_personid, phon_type)' + ;
  ' VALUES (?ln_next, ?ln_1, ?lc_bus' )
*
lcSql = ""
TEXT TO lcSql TEXTMERGE NOSHOW
Insert INTO phone (phon_phoneid, phon_personid, phon_type) 
	VALUES ( <<TRANSFORM(ln_last + 1)>>, <<TRANSFORM(ln_1)>>, '<<lc_bus>>')
ENDTEXT	
myresult = SQLEXEC(1, lcSql)
>Hi everyone...
>
>This works where ln_last and ln_1 are numeric values in variables.
>
> myresult = SQLEXEC(1,'Insert INTO phone (phon_phoneid, phon_personid) VALUES ('
+ STR(ln_last + 1) + ;
> ', '+ STR(ln_1) + ')')
>
>
>Then I try and add a character variable into a character field and get a syntax error:
>
> myresult = SQLEXEC(1,'Insert INTO phone (phon_phoneid, phon_personid, , phon_type)
VALUES (' + STR(ln_last + 1) + ;
> ', '+ STR(ln_1) + ', '+ lc_bus + ')')
>
>This doesn't work.
>
>
>Do you know how to format this correctly to get the variable value going through?
>
>Thanks
>
>Ric
--sb--
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform