next up previous contents index
Next: Access to Data Dictionaries Up: Using the Interface Previous: Insertions and Deletions of   Contents   Index

Direct Execution of SQL statements

It is also possible to execute SQL statements directly. odbc_sql_select/2 and odbc_sql/1 predicates provide this feature. The former takes an SQL query string as its input and returns a list of field values. For example:

| ?- odbc_sql_select('SELECT * FROM Test', R).

R = [t001, X-Ray, 5, 100];

...
The latter, odbc_sql/1, can be used for any other non-query SQL statement request:

| ?- odbc_sql('Create Table MyTable( Column1 DataType1, Column2 DataType2)').

yes



Baoqiu Cui
2000-04-23