Database connections can be established implicitly or explicitly. An implicit connection is a connection where the user ID is presumed to be the current user ID. This type of connection is not recommended for database applications. Explicit database connections, which require that a user ID and password be specified, are strongly recommended.
EXEC SQL CONNECT TO sample;
If you want to use a specific user id (herrick)
and password (mypassword), use the following statement:
EXEC SQL CONNECT TO sample USER herrick USING mypassword;
EXEC SQL CONNECT [ username IDENTIFIED BY password ][ USING dbname ] ;
Parameter | Description |
---|---|
username | Either a host variable or a string specifying the database user name |
password | Either a host variable or a string specifying the password |
dbname | Either a host variable or a string specifying the database name |
EXEC SQL CONNECT TO sample END-EXEC.
If you want to use a specific user id (herrick)
and password (mypassword), use the following statement:
EXEC SQL CONNECT TO sample USER herrick USING mypassword END-EXEC.
EXEC SQL CONNECT TO sample
If you want to use a specific user id (herrick)
and password (mypassword), use the following statement:
EXEC SQL CONNECT TO sample USER herrick USING mypassword
CALL SQLEXEC 'CONNECT TO sample'
If you want to use a specific user id (herrick)
and password (mypassword), use the following statement:
CALL SQLEXEC 'CONNECT TO sample USER herrick USING mypassword'