Solved

SQL/Oracle/invalid column name

Posted on 2001-08-01
3
475 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
ID: 6340469
try this
strSQL = "Select * FROM PPI.PPT_CLASS_TABLE_QCLA WHERE CLASS_CD = '" & iCode & "'"

hongjun
0
 
LVL 33

Expert Comment

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

hongjun
0
 

Author Comment

by:Rougie
ID: 6340510
That works much better! Thanks!!!
0

Featured Post

NAS Cloud Backup Strategies

This article explains backup scenarios when using network storage. We review the so-called “3-2-1 strategy” and summarize the methods you can use to send NAS data to the cloud

Question has a verified solution.

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

Suggested Solutions

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…
Along with being a a promotional video for my three-day Annielytics Dashboard Seminor, this Micro Tutorial is an intro to Google Analytics API data.
With Secure Portal Encryption, the recipient is sent a link to their email address directing them to the email laundry delivery page. From there, the recipient will be required to enter a user name and password to enter the page. Once the recipient …

803 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