stored procedures, passing dates

From: <john2321_at_my-deja.com>
Date: Wed, 08 Sep 1999 23:38:31 GMT
Message-ID: <7r6s1m$a05$1_at_nnrp1.deja.com>



Hello all,

I am trying to call a stored procedure in an ORACLE database from a C++ program.
I am using MSVC 6++ (console app)
ORACLE V 8.1.5,
OS is NT 4

I am having trouble calling a stored procedure and passing a OTYPE_DATE value as one of the parameters, below is a sample of my code:

ODatabase odb ( "tms", "chuck", "XTNQKX" );

ODynaset requestDynaset;
OParameterCollection requestParams = odb.GetParameters ();

long		lessonID;
string		lessonDesig;
long		prereqLevel;
long		priority;
long		tplID;
long		duration;
char		buffer[256];

long	startDate;
long	lookahead;

lookahead = 10;
requestParams.Add ( "StudentID", personID, OPARAMETER_INVAR, OTYPE_NUMBER ); requestParams.Add ( "StartDate", startDate, OPARAMETER_INVAR, OTYPE_DATE );

requestParams.Add ( "Lookahead", lookahead, OPARAMETER_INVAR, OTYPE_NUMBER ); requestDynaset.PlsqlOpen ( odb, "Begin
tms.p_get_student_available_events (:studentID, :RC1 ); end;", "RC1", 0L );

if ( !requestDynaset.IsOpen ()) {

        cout << "Dynaset not open." << requestDynaset.GetErrorText () << endl;
}

while ( !requestDynaset.IsEOF ()) {

// Retrieve the fields here,

        requestDynaset.MoveNext ();
}

requestDynaset.Close ();

Using the debugger, the call to the stored procedure is executed but it never gets past the check to see if the if the dynaset is open,.. I am pretty sure that we are not passing the date correctly, on the C++ side what do we declare the date value as,.. OTYPE_DATE is strictly an ORACLE data type,..??

any and all information would be greatly appreciated

john,...

Sent via Deja.com http://www.deja.com/
Share what you know. Learn what you don't. Received on Thu Sep 09 1999 - 01:38:31 CEST

Original text of this message