Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Idiot guide to using remote tables
Message
From
15/11/2003 08:28:15
Cetin Basoz
Engineerica Inc.
Izmir, Turkey
 
 
To
14/11/2003 18:50:57
General information
Forum:
Visual FoxPro
Category:
Databases,Tables, Views, Indexing and SQL syntax
Miscellaneous
Thread ID:
00849959
Message ID:
00850222
Views:
19
>sorted
>
>>SQLEXEC(gnhandle,select * from vizkeys where realkey='whatever',real)
>
>should be
>
>SQLEXEC(gnhandle,"select * from vizkeys where realkey='whatever'","real")
>
>works a treat.
>
>Thanks

Harry,
To make your life easier in the future :)

m.Search = 'whatever'
SQLEXEC(gnhandle,"select * from vizkeys where realkey=?m.Search","real")

-Using like this (parametric) you don't need to change/hardcode for different search values, hence could make this a prepared statement with SQLPrepare to gain speed. ie:

SQLPrepare(lnHandle,"select * from vizkeys where realkey=?m.Search","real")

m.Search = 'whatever'
SQLExec(lnHandle)
browse

m.Search = 'another'
SQLExec(lnHandle)
browse

SQLDisconnect(lnHandle)

-Pass large data. ie:

create cursor myTemp (myMemo m)
insert into myTemp FileToStr('myBigFile.txt')
*Or: lcMyText = FileToStr('myBigFile.txt')

SQLExec(lnHandle,'insert into SomeTable (textField) values (?myTemp.myMemo)')

-Manage multiple items easily and w/o a need to do type conversion that SQL server understand :

ldStart = date()-90
ldEnd = date()
lcCustomerID = 'ANATR'
* Other vars if any ...
SQLExec(lnHandle,'select * from Northwind.dbo.orders'+;
' where customerID = ?m.lcCustomerID and '+;
' orderDate between ?m.ldStart and ?m.ldEnd','myOrders')

PS:Notice that SQL datatype is one of datetime types, implicit conversion is done for you.
Cetin
Çetin Basöz

The way to Go
Flutter - For mobile, web and desktop.
World's most advanced open source relational database.
.Net for foxheads - Blog (main)
FoxSharp - Blog (mirror)
Welcome to FoxyClasses

LinqPad - C#,VB,F#,SQL,eSQL ... scratchpad
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform