Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Inserting into SQL table from Cursor using SQLEXEC()
Message
From
26/10/2005 12:02:51
James Blackburn
Qualty Design Systems, Inc.
Kuna, Idaho, United States
 
 
To
26/10/2005 11:08:38
Mike Cole
Yellow Lab Technologies
Stanley, Iowa, United States
General information
Forum:
Visual FoxPro
Category:
Databases,Tables, Views, Indexing and SQL syntax
Environment versions
Visual FoxPro:
VFP 7
OS:
Windows 2000 SP4
Database:
MS SQL Server
Miscellaneous
Thread ID:
01062223
Message ID:
01062254
Views:
10
Mike,

To use sqlexec() do the following
text to lcSql noshow textmerge pretext 7
insert into mytable (colu1,col2...)
values (<<nval1>>,'<<cval2>>') 
endtext 

?sqlexec(lnYourHandle,lcsql) 
with chr() values you have to add a ' outside of the <<>>.

Another option
text to lcSql noshow textmerge pretext 7
insert into mytable (colu1,col2...)
values (?nval1,?cval2) 
endtext

?sqlexec(lnYourHandle,lcsql) 
>Hello,
>I have a cursor and I want to append it to a SQL Server table. I have to use SQLEXEC though. I know how to do it when you add the table to the designer, but now I am stumped and and can't seem to find the right documentation. TIA!
>
>MAC
Previous
Reply
Map
View

Click here to load this message in the networking platform