Parameterized ODBC queries with Oracle

From: Brian Sondergaard <bsonderg_at_msn.com>
Date: 1997/02/17
Message-ID: <01bc1d24$d1ec8c60$0f3f2399_at_default>#1/1


I'm having a time trying to get a parameterized query to work with Oracle. The same code works perfectly against MS Access.

I have a CRecordset derived class that represents a simple query over a single table in an Oracle DB, and I'm trying to use a filter that's parameterized on a string (char 20) field. No matter what I try, no records are found. When I change the field on which I'm filtering to a long (number) field, things work as you'd expected.

Looking at the ODBC trace, the query looks OK, and the input parm is the right value. If I copy the query from the trace, substitute the parm value and execute in MS Query, the appropriate row is selected.

I'm using VC++ 4.2/MFC, NT 4.0, Oracle 7.1, and have tried various ODBC Drivers.

Thanks in advance!

Stumped in Atlanta,
Brian Received on Mon Feb 17 1997 - 00:00:00 CET

Original text of this message