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: select in oracle

Re: select in oracle

From: Brian Peasland <peasland_at_edcmail.cr.usgs.gov>
Date: Tue, 9 Jan 2001 14:07:16 GMT
Message-ID: <3A5B1B14.96E494B0@edcmail.cr.usgs.gov>

Tim,

You problem is not case sensitivity.

In your first SQL statement, you are essentially saying:

   SELECT * FROM some_table WHERE some_column = another_column; Oracle is telling you that another_column does not exist in some_table that you specified.

What you really want to say is:

   SELECT * FROM some_table WHERE some_column = 'some_value'; In order for Oracle (or any other ANSI SQL compliant database) to understand that you are looking for some value and not another column, you must *literally* specify the value. You do this by putting that value in single quotes for character values.

HTH,
Brian

tim leung wrote:
>
> Hi,
> I have an oracle table like the following:
>
> SQL> describe platform;
> Name Null? Type
> --------------------------------------------
> PLATFORMID NUMBER(1)
> NAME VARCHAR2(128)
> DESCRIPTION VARCHAR2(255)
>
> But when I try to get a simple select statement. I get an erorr:
>
> SQL> select * from platform where name = Win32;
> Input truncated to 1 characters
> select * from platform where name = Win32
> *
> ERROR at line 1:
> ORA-00904: invalid column name
>
> I need a single quote:
> SQL> select * from platform where name = 'WIN32';
>
> Is that I must use a single quote? Is that oracle on NT is not case
> sensitive? Since I can use upper and lower case for table name.
> Thanks.
 

-- 
========================================
Brian Peasland
Raytheons Systems at
  USGS EROS Data Center
These opinions are my own and do not
necessarily reflect the opinions of my 
company!
========================================
Received on Tue Jan 09 2001 - 08:07:16 CST

Original text of this message

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