Rougie
asked on
SQL/Oracle/invalid column name
I'm trying to pull some data drom an Oracle database and it woeks fine with:
iCode = "00001"
Dim strSQL
strSQL = "Select * FROM PPI.PPT_CLASS_TABLE_QCLA WHERE CLASS_CD = '00001'"
But when I try the following I get the error message pasted below.
iCode = "00001"
Dim strSQL
strSQL = "Select * FROM PPI.PPT_CLASS_TABLE_QCLA WHERE CLASS_CD = iCode"
Here is the error message I get:
Microsoft OLE DB Provider for ODBC Drivers error '80040e14'
[Microsoft][ODBC driver for Oracle][Oracle]ORA-00904: invalid column name
Anyone have any idea what I'm doing wrong?
iCode = "00001"
Dim strSQL
strSQL = "Select * FROM PPI.PPT_CLASS_TABLE_QCLA WHERE CLASS_CD = '00001'"
But when I try the following I get the error message pasted below.
iCode = "00001"
Dim strSQL
strSQL = "Select * FROM PPI.PPT_CLASS_TABLE_QCLA WHERE CLASS_CD = iCode"
Here is the error message I get:
Microsoft OLE DB Provider for ODBC Drivers error '80040e14'
[Microsoft][ODBC driver for Oracle][Oracle]ORA-00904: invalid column name
Anyone have any idea what I'm doing wrong?
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
That works much better! Thanks!!!
hongjun