Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
SQL INSERT
Message
From
21/03/2000 17:28:42
 
 
To
21/03/2000 17:24:13
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Title:
Miscellaneous
Thread ID:
00348619
Message ID:
00348624
Views:
27
>I don't know how to make this work:
>
>lcfyr =cursor.fyr
>lcflag = 1 && this is a "bit" data type in SQL server
>
>cSQL="INSERT INTO Table (fyr,Flag)"
>cSQL=cSQL + " VALUES ('"+lcfyr+"',"+lcflag+")"
>
>Now when I check the variable in DEBUG lcflag is 1 numeric, but it desn't insert, I get a operator/oparand error

Since you are building up a character string, you need to convert it to a character value:
cSQL="INSERT INTO Table (fyr,Flag)"
cSQL=cSQL + " VALUES ('"+lcfyr+"',"+ALLTRIM(STR(lcflag))+")"
Fred
Microsoft Visual FoxPro MVP

foxcentral.net
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform