Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.tools -> Re: newbie sql question

Re: newbie sql question

From: Rudy Zung <_spamkill_zungr_at_prograph-inc.com>
Date: 1999/04/12
Message-ID: <7et8r6$ajp$1@mailhost.prograph-inc.com>#1/1

>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

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US