Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.tools -> Re: newbie sql question
>Hi,
>
>I'm doing a project for class using Oracle Sqlplus and am stuck on a
problem.
>I've created a view and am trying to query the view but get an error
message.
>Any help would be appreaciated!
>
>Here's what I have, the error message is below.
>
>Vic
[...deleted snippet of Oracle not finding column...]
>
Oracle is a case-sensitive system, and by default will internally convert SQL statements into uppercase, UNLESS explicitly quoted into lower or mixed-case. Oracle uses double-quotes for quoting object names (table names, column names, index names, names that occur in DDL statements), so when you do:
create table foo (k number)
versus
create table "foo" ("k" number)
you get two different tables; in the first case your table is
FOO with field K; in the second case you get lower-case
foo and lower-case k. Being that Oracle defaults to uppercase,
when you
select * from foo
you are selecting from the uppercase FOO table. To
get to the lower-case foo table, you need to
select * from "foo"
The lesson to be learnt here is unless you have a very good reason for doing so, it is generally better NOT to quote any object names in Oracle.
Beware also of using double-quotes for quoting strings, Oracle tends to think that you are trying to reference a column/table name; use single quotes for strings.
HTH. ...Ru Received on Mon Apr 12 1999 - 00:00:00 CDT
![]() |
![]() |