Solved

Getting "Syntax Error: Expecting identifier or quoted identifier." exception when trying to use DataAdapter.FillSchema() on an Oracle Database

Posted on 2009-05-08
5
2,699 Views
Last Modified: 2013-12-18
I am working an a Visual Studio 2008 C# application connecting to an Oracle 10.2 database using built in .NET data object for Oracle.

My code as exists looks like:

da.FillSchema(sourceDt, SchemaType.Mapped);



When I run this code, I get the following exception: "Syntax Error: Expecting identifier or quoted identifier."

The SQL that is being run is: select * from (SELECT * FROM company) OracleTestSQL

This select works correctly when run directly against the database when using a tool like DBVisualizer.

The code also works perfectly, without generating any exception when I change it to the following:

da.Fill(sourceDt);



Granted, I could just use that last bit of code, but for reasons of speed and latency, I want to only get the schema/data that I need, rather then alot of extra data.

Any help/suggestions would be greatly appreciated! Thanks in advance!

Aaron@Exago

0
Comment
Question by:StewartMeyers
[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
  • 3
5 Comments
 
LVL 143

Expert Comment

by:Guy Hengel [angelIII / a3]
ID: 24339453
cna you please explain why you run that subquery?
or is that just a sample or what you really want to run?

listening...
0
 

Author Comment

by:StewartMeyers
ID: 24339511
That SQL sample was just a testing sample. It can be any possible sub query, but in my testing, I just happened to use a basic sub select in the overall select.

The application needs to be any type of sub select and or joins, etc and treat it as a data object.

Hopefully that helps to clarify.
 
 
0
 
LVL 6

Expert Comment

by:RPCIT
ID: 24339512
try explicitly defining the field names in the select...

select field1, field2, field3, field4, from (SELECT * FROM company) OracleTestSQL


The scheme mapping may not know how to deal with the wildcard field operator
0
 

Author Comment

by:StewartMeyers
ID: 24339572
Thanks RPCIT, but I wouldn't worry about the select *. It's standard SQL and works (and generates the proper rows/data) in any other SQL editor connecting to the same database using the same database connector (I'm using DBVisualizer). If the schema mapping didn't know how to deal with the wildcard, I would think it would also throw the error in any tool.

Thanks again.
0
 

Accepted Solution

by:
StewartMeyers earned 0 total points
ID: 24369433
I found found the answer to the problem myself. The code works just fine if I use the Oracle provided .NET Data Adapter instead of using Microsoft's provided Data Adapter for Oracle.
0

Featured Post

Independent Software Vendors: 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
Updating a temp table inside a PL/SQL block 3 51
Regarding swagger API 1 38
SQL query to select row with MAX date 7 43
scheduler notification 9 43
A long time ago (May 2011), I have written an article showing you how to create a DLL using Visual Studio 2005 to be hosted in SQL Server 2005. That was valid at that time and it is still valid if you are still using these versions. You can still re…
Get to know the ins and outs of building a web-based ERP system for your enterprise. Development timeline, technology, and costs outlined.
This video shows, step by step, how to configure Oracle Heterogeneous Services via the Generic Gateway Agent in order to make a connection from an Oracle session and access a remote SQL Server database table.
Via a live example, show how to take different types of Oracle backups using RMAN.

697 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