Oracle PL/SQL code execution from Timesten

As you know, TimesTen has opportunity to execute SQL statements directly from Oracle DB (using Passthrough). What about PL/SQL? Unfortunately, documentation says:

"A PL/SQL block cannot be passed through to the Oracle database for execution.
Also, you cannot pass through to Oracle for execution a reference to a stored procedure or function that is
defined in the Oracle database but not in the TimesTen database."

It is true, you can not use passthrough feature for PL/SQL, but you can use it for SQL. It means that you can execute PL/SQL from Oracle DB which could be executed from SQL. For example:

Suppose, we have a function in Oracle which we would like to execute:

SQL> create function test_r return number
  return 1;

Function created.

SQL> select test_r from dual;



Create one table which doesn't exist in TimesTen side.

SQL> create table tt (id number);

Table created.

SQL> select * from tt;

no rows selected

SQL> insert into tt values (3);

1 row created.

SQL> commit;

Commit complete.


In TimesTen:
Command> select test_r from dual;
 2211: Referenced column TEST_R not found
The command failed.
Command> set autocommit 0;
Command> call ttOptSetFlag('PassThrough', 1);
Command> select * from;
< 3 >
1 row found.
Command> select oratt.test_r from;
< 1 >
1 row found.

This method, of course, has some restrictions for PL/SQL execution, but in any case, it is better than nothing :)