SQL Pass-Through Facility Specifics for SAP IQ

Key Information

For general information about this feature, see SQL Pass-Through Facility.

Here are the SQL pass-through facility specifics for the SAP IQ interface.

CONNECT Statement Example

This example uses the DBCON alias to connection to the iqsrv1 SAP IQ database and execute a query. The connection alias is optional.

proc sql;
   connect to sapiq as dbcon
   (host=iqsvr1 server=iqsrv1_users db=users user=iqusr1 password=iqpwd1);
select * from connection to dbcon
   (select * from customers where customer like '1%');
quit;

Requirement for ORDER BY Variables

The SAP IQ database requires that a variable that is specified in an ORDER BY clause must also be included in a SELECT clause for a query. If you specify a variable in an ORDER BY clause that is not in the SELECT statement, you receive an error in the SAS log and the query fails.

Special Catalog Queries

SAS/ACCESS Interface to SAP IQ supports the following special queries. You can the queries use to call the ODBC-style catalog function application programming interfaces (APIs). Here is the general format of the special queries:

SIQ::SQLAPI "parameter 1","parameter n"
SIQ::

is required to distinguish special queries from regular queries. SIQ:: is not case sensitive.

SQLAPI

is the specific API that is being called. SQLAPI is not case sensitive.

"parameter n"

a quoted string that is delimited by commas.

Within the quoted string, two characters are universally recognized: the percent sign (%) and the underscore (_). The percent sign matches any sequence of zero or more characters, and the underscore represents any single character. To use either character as a literal value, you can use the backslash character (\) to escape the match characters. For example, this call to SQLTables usually matches table names such as myatest and my_test:

select * from connection to sapiq (SIQ::SQLTables "test","","my_test");

Use the escape character to search only for the my_test table:

select * from connection to sapiq (SIQ::SQLTables "test","","my\_test");

SAS/ACCESS Interface to SAP IQ supports these special queries.

SIQ::SQLTables <"Catalog", "Schema", "Table-name", "Type">

returns a list of all tables that match the specified arguments. If you do not specify any arguments, all accessible table names and information are returned.

SIQ::SQLColumns <"Catalog", "Schema", "Table-name", "Column-name">

returns a list of all columns that match the specified arguments. If you do not specify any argument, all accessible column names and information are returned.

SIQ::SQLPrimaryKeys <"Catalog", "Schema", "Table-name">

returns a list of all columns that compose the primary key that matches the specified table. A primary key can be composed of one or more columns. If you do not specify any table name, this special query fails.

SIQ::SQLSpecialColumns <"Identifier-type", "Catalog-name", "Schema-name", "Table-name", "Scope", "Nullable">

returns a list of the optimal set of columns that uniquely identify a row in the specified table.

SIQ::SQLStatistics <"Catalog", "Schema", "Table-name">

returns a list of the statistics for the specified table name. You can set SQL_INDEX_ALL and SQL_ENSURE options in the SQLStatistics API call. If you do not specify any table name argument, this special query fails.

SIQ::SQLGetTypeInfo

returns information about the data types that the SAP IQ database supports.

Last updated: February 3, 2026