Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.misc -> oo4o and parameters

oo4o and parameters

From: Eric Lepage <elepage_at_dynagram.com>
Date: Tue, 12 Oct 1999 14:52:47 -0400
Message-ID: <3803837F.5F249AAD@dynagram.com>


Hello,

I'm unable to use parameters with OO4O in Visual C++. Replacing the parameter in the WHERE clause with a regular assignment will return a valid dynaset. But using a parameter returns an empty set. I've checked for all error codes, all seems well except using parameters doesn't work. Does anyone know what detail I'm forgetting which could explain this failure? Thanks!

The code basically look likes this:

 ODatabase mOraDb;
 ODynaset mReadSet;
 CString strSql;
 oresult or;

 ... connect to the db

 OParameterCollection paCollect = mOraDb.GetParameters();  paCollect.Add("paCol1", "", OPARAMETER_INVAR, OTYPE_CHAR);  OParameter paCol1 = paCollect.GetParameter("paCol1");  or = paCol1.SetValue("123");
 if(or == OFAILURE)
   {
    return
   }

// go find some meat!
 strSql.Format("SELECT mycol1, mycol2, mycoletc FROM MyTable WHERE mycol1 = :paCol1");
 or = mReadSet.Open(mOraDb, strSql, ODYNASET_READONLY);



Eric Lepage - Dynagram Software ( http://www.dynagram.com ) Received on Tue Oct 12 1999 - 13:52:47 CDT

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US