You use the SET SERVERDB statement to specify information on connecting to the database instance in the SQL mode INTERNAL. This includes defining which database instance on which server you want the application program to connect to.
EXEC SQL [<session_number>] SET SERVERDB <database_name> [ON <database_server>];
· You can also specify the name of the database instance <database_name> and the server <database_server> on which it runs in a host variable with the data type char.
· Enter <session_number> as the session number if you want your application program to open multiple database sessions in parallel. In the SQL mode INTERNAL, there can be a maximum of eight parallel sessions with different MaxDB database instances.
You can override the information from the SET SERVERDB statement with the KEY in the CONNECT statement.
When the precompiler runs, you can also override the information from the SET SERVERDB statement for all database sessions with the precompiler options –d and -n.