Support for TimesTen Built-In Procedures

You can call TimesTen built-in procedures directly from TimesTen OCI only for built-ins that do not return a result set. Therefore, this restriction also applies to ODP.NET for TimesTen.

Use an OracleCommand instance to call a built-in, as in the following example. This assumes an OracleConnection instance conn with a connection to TimesTen has been established. Call the Dispose method to free resources when you have finished using the OracleCommand instance.

// switching to passthrough 1 mode using ttOptSetFlag built-in function
string switchModeStmt = "call ttOptSetFlag('passthrough', 1)";
OracleCommand switchCmd = new OracleCommand(switchModeStmt, conn);
switchCmd.CommandType = CommandType.Text;
switchCmd.ExecuteNonQuery();
switchCmd.Dispose();

For built-in procedures that do return a result set, the result set would not be accessible directly through ODP.NET. However, you could access it as an OUT parameter if you call the built-in from PL/SQL. Here is an example:

int passThruValue = -1;
OracleCommand cmd = conn.CreateCommand();
cmd.CommandText = "declare v_name varchar2(255); begin execute immediate 
                  'call ttOptGetFlag(''passthrough'')' into v_name, :rc1; end;";
cmd.Parameters.Add("rc1", OracleDbType.Int32, -1, ParameterDirection.Output);
cmd.ExecuteNonQuery();
passThruValue = Convert.ToInt32(cmd.Parameters[0].Value.ToString());
cmd.Parameters.Clear();
cmd.Dispose();