Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Executing two command in one string
Message
 
 
To
21/03/2013 20:00:13
General information
Forum:
Visual FoxPro
Category:
Other
Environment versions
Visual FoxPro:
VFP 9 SP1
Miscellaneous
Thread ID:
01568990
Message ID:
01568995
Views:
55
>Hi,
>
>I think I can sent two command to SQL Server from VFP app (using SQLEXEC()) but I am not sure what separator to use. Should it be semi colon? For example if I want to alter a column and then set a value into this column, can I do the following:
>
>
>cSqlCmd = "alter table MyTable alter column MyFld1 char(30); update MyTable set MyFld1 = repl('0',30) where len(MyFld1) = 0"
>nRetunr = SQLEXEC(nConn, cSqlCmd)
>
>
>Will the above work? TIA
>
>UPDATE. I ran it and it works.

Yes, you can and should use semicolon. You can also use text endtext to put commands in multiple lines to improve readability.
If it's not broken, fix it until it is.


My Blog
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform