Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

ORACLE Error 00936

Posted on 2011-03-01
4
Medium Priority
?
406 Views
Last Modified: 2013-12-07
Below is the code I am using in an Access module. I've step through everything and I know the connection works fine; but, I am getting errors at the "ODBCRecordset1.Open" line. I would like to be able to run this each night then loop through the values and paste them into another table (in access). I have done this succesfully with other Oracle DB's but cant seem to get this one to work. The errors I get most frequenty are "ORA-00936 - Missing Expression" and "ORA- 00933 - SQL not properly ended"
Also, initially there were some WHERE clauses but even after I removed them I got the same errors

Any help would be great.



Public Function Connect()

Const adlockoptimistic = 3
Const adopenstatic = 3
Const aduseclient = 3


Dim ODBCConnectionString
Dim ODBCRecordset1


Set ODBCConnectionString = CreateObject("ADODB.connection")
Set ODBCRecordset1 = CreateObject("ADODB.recordset")



ODBCConnectionString.Open "Driver=Microsoft ODBC for Oracle;Server=-----;Uid=----;Pwd----;"
ODBCConnectionString.CommandTimeout = 1200
ODBCRecordset1.Open "SELECT [TECSDAT-XLPD].[PKG_XCP_RPT_DT], [TECSDAT-XLPD].[PKG_XCP_RPT_CNY_CD], [TECSDAT-XLPD].[PKG_TCK_NR], [TECSDAT-XLPD].[PKG_XCP_RSN_CD], [TECSDAT-XLPD].[SHR_AC_NR] FROM [TECSDAT-XLPD]", ODBCConnectionString, adopenstatic, adlockoptimistic


ODBCConnectionString.Close

End Function

Open in new window

0
Comment
Question by:JClayton7
[X]
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
4 Comments
 
LVL 143

Expert Comment

by:Guy Hengel [angelIII / a3]
ID: 35008931
in Oracle, don't use [object _name], but "object_name"

0
 
LVL 15

Expert Comment

by:Aaron Shilo
ID: 35010053
hi
line 19 is wrong

fix : ODBCRecordset1.Open "SELECT TECSDAT-XLPD.PKG_XCP_RPT_DT, TECSDAT-XLPD.PKG_XCP_RPT_CNY_CD, TECSDAT-XLPD.PKG_TCK_NR, TECSDAT-XLPD.PKG_XCP_RSN_CD, TECSDAT-XLPD.SHR_AC_NR FROM TECSDAT-XLPD", ODBCConnectionString, adopenstatic, adlockoptimistic


0
 

Accepted Solution

by:
JClayton7 earned 0 total points
ID: 35010331
Thanks everyone! Ended up being t."fieldname" - I think its a table alias problem
0
 

Author Closing Comment

by:JClayton7
ID: 35431187
Figured out the answer before anyone posted it
0

Featured Post

New feature and membership benefit!

New feature! Upgrade and increase expert visibility of your issues with Priority Questions.

Question has a verified solution.

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

Why doesn't the Oracle optimizer use my index? Querying too much data Most Oracle developers know that an index is useful when you can use it to restrict your result set to a small number of the total rows in a table. So, the obvious side…
How to Create User-Defined Aggregates in Oracle Before we begin creating these things, what are user-defined aggregates?  They are a feature introduced in Oracle 9i that allows a developer to create his or her own functions like "SUM", "AVG", and…
This video shows how to Export data from an Oracle database using the Original Export Utility.  The corresponding Import utility, which works the same way is referenced, but not demonstrated.
This video shows how to copy an entire tablespace from one database to another database using Transportable Tablespace functionality.

722 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