[Last Call] Learn about multicloud storage options and how to improve your company's cloud strategy. Register Now

x
?
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
Medium Priority
?
2,787 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

Technology Partners: 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

This post first appeared at Oracleinaction  (http://oracleinaction.com/undo-and-redo-in-oracle/)by Anju Garg (Myself). I  will demonstrate that undo for DML’s is stored both in undo tablespace and online redo logs. Then, we will analyze the reaso…
"Disruption" is the most feared word for C-level executives these days. They agonize over their industry being disturbed by another player - most likely by startups.
This video shows how to set up a shell script to accept a positional parameter when called, pass that to a SQL script, accept the output from the statement back and then manipulate it in the Shell.
Via a live example, show how to restore a database from backup after a simulated disk failure using RMAN.
Suggested Courses

650 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