Solved

SQL/Oracle/invalid column name

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

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Validating Date Part2 2 27
Replace value 2 35
Use Mid in Html 6 23
Can't select treeview node from iframe 2 39
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 informatio…
Have you ever needed to get an ASP script to wait for a while? I have, just to let something else happen. Or in my case, to allow other stuff to happen while I was murdering my MySQL database with an update. The Original Issue This was written…
Nobody understands Phishing better than an anti-spam company. That’s why we are providing Phishing Awareness Training to our customers. According to a report by Verizon, only 3% of targeted users report malicious emails to management. With compan…

730 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