ORA-01008: not all variables bound exception, however, using a debugger, I
see that at line 27402 or 27404 (args_strm << otl_null() or args_strm <<
schema_name) the program leaps off to a strange place.
I am running on
SunOS sundev14 5.9 Generic_118558-18 sun4u sparc SUNW,Sun-Fire
using Sun C++ compiler:
CC: Sun C++ 5.5 Patch 113817-12 2005/03/08
Oracle Database 10g Enterprise 10.2.0.3 - 64bi
otl v 4.0.173
Here is my sample program:
#include <iostream>
using namespace std;
#define OTL_ORA10G_R2
#define OTL_EXPLICIT_NAMESPACES
#define OTL_VALUE_TEMPLATE_ON
#define OTL_STL
unsigned int my_trace_level= 0x1 | // 1st level of tracing
0x2 | // 2nd level of tracing
0x4 | // 3rd level of tracing
0x8 | // 4th level of tracing
0x10; // 5th level of tracing// each level of tracing is represented by its own
bit,
// so levels of tracing can be combined in an arbitrary order.
#define OTL_TRACE_LEVEL my_trace_level // enables OTL tracing, and uses
my_trace_level as a trace control variable.
#define OTL_TRACE_STREAM cerr // directs all OTL tracing to cerr
#define OTL_TRACE_LINE_PREFIX "MY OTL TRACE ==> "
#include <otlv_4.h>
using namespace oracle;
otl_connect db;
static void create_proc()
{
otl_cursor::direct_exec(db,
"create or replace procedure fundamentals.test_sel"
" (f1 in number,"
" f2 out varchar2) "
" is "
" begin "
" f2 := 'HELLO'; "
" end; "
);
static void drop_proc()
{
otl_cursor::direct_exec(db, "drop procedure fundamentals.test_sel");
}
int main(int argc, char **argv)
{
otl_connect::otl_initialize();
try
{
db.rlogon("/* YOUR TEST LOGIN HERE */");
create_proc();
otl_stream s;
char sql_stmt[8192];
int stmt_type;
char refcur_placeholder[128];
otl_stream::create_stored_proc_call(db,
s, sql_stmt, stmt_type,
refcur_placeholder, "test_sel",
NULL, "FUNDAMENTALS", true);
cerr << sql_stmt << endl;
drop_proc();
}
catch (otl_exception &e)
{
cerr << e.msg << endl;
}
db.logoff();
}