Chapter Contents |
Previous |
Next |
CONNECT Statement |
Optional statement |
Syntax | |
Arguments | |
Informix Connection Arguments | |
Example |
Syntax |
CONNECT TO INFORMIX <AS alias> <(Informix-connection-arguments)>; |
Informix Connection Arguments |
You can connect to only one Informix database. However,
you can specify multiple CONNECT statements if they all connect to the same
Informix database. If you use multiple connections, you must use an alias to identify the different connections. If you omit an alias,
informix
is automatically used.
When you omit a CONNECT statement, an implicit connection is performed when the first EXECUTE statement or CONNECTION TO component is passed to the DBMS.
The CONNECT statement is optional when connecting to an Informix database if the DBDATABASE environment variable has been set to include both the database and server specification. See Using the DBDATABASE Environment Variable for more information.
Any return code or message that is generated by the DBMS or by the SQL Procedure Pass-through facility is available in the macro variables SQLXRC and SQLXMSG after the statement executes.
Informix uses the following database connection arguments. These arguments must be enclosed in parentheses.
By using a full pathname, you can specify a database as well as a database server in the DATABASE argument.
You can set default values for the DATABASE= argument and therefore, the argument is optional. See Using the DBDATABASE Environment Variable for more information.
You can use the DBDATABASE environment variable to specify database/server combinations, such as database@server or //server/database.
USING can also be specified with the PASSWORD= and PWD=aliases.
This example connects
to the Informix database
stores7
by using the
online
server. The database name is quoted because it includes special characters.
proc sql; connect to informix (user=SCOTT password=TIGER database='//online/stores7');
Note: You can use the DBDATABASE environment variable to specify
database/server combinations, such as database@server or //server/database.
Chapter Contents |
Previous |
Next |
Top of Page |
Copyright 1999 by SAS Institute Inc., Cary, NC, USA. All rights reserved.