I remember there was example to connect to two databases/sessions. I could not locate it.
I want to copy some tables from Oracle to PostgreSQL,
Any example using TWO SQL sessions simultaneously will be useful.
It is basically the same, the only thing to keep in mind:
Sql is using default database "SQL" if no session is specified for it. When you have 2 databases, this is obviosly impossible. So you need to specify at least one of them for each Sql you are using. Perhaps it is even prudent to stop using global SQL. Anyway, it might look like this:
MySQLSession mysql_session;
Sqlite3Session sqlite3_session;
... login etc...
SQL = mysql_session; // MySQL will be default
Sql mysql; // default is MySQL, no need to specify session
Sql sqlite3(sqlite3_session); // explicitly specify that this is connected to sqlite3
mysql * Select(FOO).From(BAR);
while(mysql.Fetch())
sqlite3 * Insert(BAR)(FOO, mysql[0]);