Oracle database demands SELECT "column1" FROM "table" syntax

T

Torgeir

Hi


I have a problem with the syntax of the SQL commands I use with the Oracle
10g Express database (from an asp.net 2.0 application using
system.data.oracleclient). The database wants the queries formulated as in
this example:
SELECT "Company"."Name" AS "Name"
FROM "Company" "Company"

This is a query I would normally write like this:
SELECT name FROM company

Why is this? The problem is that when I run the application in another
environment (against another Oracle database), the SQL syntax is invalid.
Please tell me this is some database setting that can be easily changed!
This has probably little to do with ado.net, but perhaps some of you have
experienced this.



Regards,
Torgeir
 
F

Frans Bouma [C# MVP]

Torgeir said:
Hi


I have a problem with the syntax of the SQL commands I use with the
Oracle 10g Express database (from an asp.net 2.0 application using
system.data.oracleclient). The database wants the queries formulated
as in this example: SELECT "Company"."Name" AS "Name" FROM
"Company" "Company"

This is a query I would normally write like this:
SELECT name FROM company

Why is this? The problem is that when I run the application in
another environment (against another Oracle database), the SQL syntax
is invalid. Please tell me this is some database setting that can be
easily changed! This has probably little to do with ado.net, but
perhaps some of you have experienced this.

Oracle is by default case sensitive. So if your table / schema / field
has lower cased characters in the name, you have to specify "" around
it, otherwise Oracle will look for the all capitol variant of the name.

FB

--
------------------------------------------------------------------------
Lead developer of LLBLGen Pro, the productive O/R mapper for .NET
LLBLGen Pro website: http://www.llblgen.com
My .NET blog: http://weblogs.asp.net/fbouma
Microsoft MVP (C#)
------------------------------------------------------------------------
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top