Table.SQL_Open Method

Syntax

P tbl = Table.SQL_Open(C connection,C selectStatement [,L portable, [sql::arguments Args ]])

Description

Create a temporary table from a SQL statement.

Examples

dim t as p
t = table.sql_open("::Name::Alphasports","select * from customer",.t.)
? t.fields_get()
= 21
? t.FIRSTNAME
= "James               "
? t.LASTNAME
= "Mahoney             "
? t.filename_get()
= "C:\Users\Cian\AppData\Local\Temp\$$504B.dbf"
t.close()

Note that the files go away after the table is closed.

? file.exists("C:\Users\Cian\AppData\Local\Temp\$$504B.dbf")
= .F.

Using arguments:

dim args as sql::arguments
args.add("C:\Users\Cian\AppData\Local\Temp\$$504B.dbf","whatState")
t = table.sql_open("MA","::Name::AlphaSports",.t.,args)

See Also