| Oracle FAQ | Your Portal to the Oracle Knowledge Grid | |
Home -> Community -> Usenet -> c.d.o.server -> Re: Table not found with jdbc sql statement
"Thomas Kellerer" <spam_eater_at_gmx.net> wrote in message
news:bnquup$14stg2$1_at_ID-13919.news.uni-berlin.de...
> Simon Bieri schrieb:
>
> > Hi
> >
> > I have a big problem. I created some tables in a db with a standard sql
> > script (script is below).
> > Now I try to select the table DbTableOne with a normal java script via
> > oracles jdbc thin driver (I tried with both classes111.zip as well
> > classes12.zip). When I enter the table name without double quotes
> > (DbTableOne), I can connect to it. When I enter the table name with the
> > double quotes ("DbTableOne"), I receive the error message, that there's
> > no such table.
> >
> > What's wrong? With SQL 99 standard this should not be a problem?
> >
> In contrary:
>
> The SQL standard says that as soon as you put an object in double quotes,
the
> database has to handle that case sensitive. When you create a table in
Oracle
> the table name is stored in uppercase, thus your mixed case name is not
found.
> btw: SQL*Plus should react in the same way.
As I read it the OP ran the create table script with quotes in sqlplus. As a
result he got a mixed case table name.
eg
SQL*Plus: Release 9.2.0.4.0 - Production on Thu Oct 30 13:07:18 2003
Copyright (c) 1982, 2002, Oracle Corporation. All rights reserved.
Connected to:
Oracle9i Release 9.2.0.3.0 - Production
JServer Release 9.2.0.3.0 - Production
SQL> CREATE TABLE "DbTableOne"
2 (
3 "DateTime" VARCHAR2(20) NOT NULL, 4 "Id" VARCHAR2(8) NULL, 5 "Status" VARCHAR2(2) NULL, 6 "ErrorDescr" VARCHAR2(300) NULL, 7 "MessageTextA" VARCHAR2(2000) NULL, 8 "MessageTextB" VARCHAR2(2000) NULL, 9 "MessageTextC" VARCHAR2(2000) NULL, 10 "MessageTextD" VARCHAR2(2000) NULL, 11 "MessageTextE" VARCHAR2(2000) NULL12 )
Table created.
SQL> select table_name from user_tables where table_name != upper(table_name);
TABLE_NAME
SQL> I don't have a working java ide at the moment to test out what is happening, and in any case we haven't seen the java code that tries to select from the table.
>
> From my point of view using double quotes for table names is a bad habit
and
> should be avoided at all.
This I entirely agree with.
-- Niall Litchfield Oracle DBA Audit Commission UkReceived on Thu Oct 30 2003 - 07:11:03 CST
![]() |
![]() |