SQL/Oracle/invalid column name

Posted on 2001-08-01
Last Modified: 2008-01-16
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


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?
Question by:Rougie
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
LVL 33

Accepted Solution

hongjun earned 100 total points
ID: 6340469
try this
strSQL = "Select * FROM PPI.PPT_CLASS_TABLE_QCLA WHERE CLASS_CD = '" & iCode & "'"

LVL 33

Expert Comment

ID: 6340475
iCode is a variable name and not a field name. Thus you got to separate it from the "..."


Author Comment

ID: 6340510
That works much better! Thanks!!!

Featured Post

PeopleSoft Has Never Been Easier

PeopleSoft Adoption Made Smooth & Simple!

On-The-Job Training Is made Intuitive & Easy With WalkMe's On-Screen Guidance Tool.  Claim Your Free WalkMe Account Now

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

I would like to start this tip/trick by saying Thank You, to all who said that this could not be done, as it forced me to make sure that it could be accomplished. :) To start, I want to make sure everyone understands the importance of utilizing p…
I was asked about the differences between classic ASP and ASP.NET, so let me put them down here, for reference: Let's make the introductions... Classic ASP was launched by Microsoft in 1998 and dynamically generate web pages upon user interact…
If you’ve ever visited a web page and noticed a cool font that you really liked the look of, but couldn’t figure out which font it was so that you could use it for your own work, then this video is for you! In this Micro Tutorial, you'll learn yo…
Do you want to know how to make a graph with Microsoft Access? First, create a query with the data for the chart. Then make a blank form and add a chart control. This video also shows how to change what data is displayed on the graph as well as form…

696 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question