The sqlLib.setCurrentDatabase() system function makes the specified database currently active. Each run unit has a current connection, and the SQL statements operate on the current connection. Each new sqlLib.connect() call typically changes the current connection. To reset your connection to a previous value, use sqlLib.setCurrentDatabase().
sqlLib.setCurrentDatabase(database STRING in)
The following example shows how to use sqlLib.setCurrentDatabase():
connect( "db1a", "user", "pwd" );
// Drop table xyz from database db1a
execute #sql{ drop table xyz };
connect( "db1b", "user", "pwd" );
// Drop table xyz from database db1b
execute #sql{ drop table xyz };
setCurrentDatabase( "db1a" );
// Drop table xyz2 from database db1a
execute #sql{ drop table xyz2 };
// Disconnect from db1a (the current connection)
disconnect( "db1a" );
// Since the current connection was closed by
// the previous statement, EGL connects to
// the default database before running this statement
execute #sql{ drop table xyz3 };
// Disconnect from the current connection,
// whatever it happens to be
disconnect();
setCurrentDatabase( "db1b" );
// Drop table xyz2 from database db1b
execute #sql{ drop table xyz2 };