Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.misc -> oo4o and parameters
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);
![]() |
![]() |