Oracle Objects for OLE - parameters

From: Eric Lepage <elepage_at_dynagram.com>
Date: Mon, 11 Oct 1999 23:04:34 GMT
Message-ID: <38026D49.39CB_at_dynagram.com>



Hello,

[Quoted] 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 Received on Tue Oct 12 1999 - 01:04:34 CEST

Original text of this message