Solved

SQL/Oracle/invalid column name

Posted on 2001-08-01
3
472 Views
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


     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?
0
Comment
Question by:Rougie
  • 2
3 Comments
 
LVL 33

Accepted Solution

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

hongjun
0
 
LVL 33

Expert Comment

by:hongjun
Comment Utility
iCode is a variable name and not a field name. Thus you got to separate it from the "..."

hongjun
0
 

Author Comment

by:Rougie
Comment Utility
That works much better! Thanks!!!
0

Featured Post

What Is Threat Intelligence?

Threat intelligence is often discussed, but rarely understood. Starting with a precise definition, along with clear business goals, is essential.

Join & Write a Comment

I have helped a lot of people on EE with their coding sources and have enjoyed near about every minute of it. Sometimes it can get a little tedious but it is always a challenge and the one thing that I always say is:  The Exchange of information …
Hello, all! I just recently started using Microsoft's IIS 7.5 within Windows 7, as I just downloaded and installed the 90 day trial of Windows 7. (Got to love Microsoft for allowing 90 days) The main reason for downloading and testing Windows 7 is t…
Sending a Secure fax is easy with eFax Corporate (http://www.enterprise.efax.com). First, Just open a new email message.  In the To field, type your recipient's fax number @efaxsend.com. You can even send a secure international fax — just include t…
This video demonstrates how to create an example email signature rule for a department in a company using CodeTwo Exchange Rules. The signature will be inserted beneath users' latest emails in conversations and will be displayed in users' Sent Items…

744 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

Need Help in Real-Time?

Connect with top rated Experts

8 Experts available now in Live!

Get 1:1 Help Now