Problems using OCCI ,get Date [message #128500] |
Tue, 19 July 2005 00:18 |
hilson
Messages: 2 Registered: July 2005
|
Junior Member |
|
|
hi,
my OCCI environment = Environment::createEnvironment( Environment::THREADED_UNMUTEXED);
i have a proceduce p_xxx(code in number, mydate out date);
how to get mydate? if i don't want to use date object.
my source code:
Statement *stmt=connection->createStatement("BEGIN p_xxx(:code,:mydate); END;");
string mycode="123";
stmt->setString(1,mycode);
stmt->registerOutParam(2,OCCIDATE);
stmt->execute();
Date xx=getDate(2); //<---------here throw exception, ora21301 not init for object module. (i must create my environment to THREADED_UNMUTEXED )
can i use to_char function to get date ?
Statement *stmt=connection->createStatement("BEGIN p_xxx(:code,to_char(:mydate,'YYYYMMDDHH24MISS'); END;");
string mycode="123";
stmt->setString(1,mycode);
stmt->registerOutParam(2,OCCISTRING,100,"");
stmt->execute();
string mydate=stmt->getString(2);
but fail to compile! to_char(:mydate,...) is wrong.
how can i get this output Date type ?
best regard
thx all.
|
|
|
|
|
|