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

Home -> Community -> Mailing Lists -> Oracle-L -> Re: Something i'm missing

Re: Something i'm missing

From: GovindanK <gkatteri_at_gmail.com>
Date: Wed, 15 Aug 2007 17:03:13 -0700
Message-ID: <46C39441.8090808@inbox.lv>


Andrew Kerber wrote:
> try ... where blah_col=blah_col
>
> (just put the column name in the & variable).
>

This is not to undermine what Andrew said. Andrew's answer is good answer but it skips null values as you see it below.

SQL> create table my_emp(empno number , empcatg varchar(1));

Table created.

SQL> insert into my_emp values(1, 'A');

1 row created.
SQL> insert into my_emp values(2, 'B');

1 row created.

SQL> select * from my_emp where empcatg=&blah; Enter value for blah: empcatg
old 1: select * from my_emp where empcatg=&blah new 1: select * from my_emp where empcatg=empcatg

     EMPNO E
---------- -

         1 A
         2 B

SQL> update my_emp set empcatg=null where empno > 1;

1 row updated.

SQL> select * from my_emp where empcatg=&blah; Enter value for blah: empcatg
old 1: select * from my_emp where empcatg=&blah new 1: select * from my_emp where empcatg=empcatg

     EMPNO E
---------- -

         1 A

SQL> HTH
GovindanK

--
http://www.freelists.org/webpage/oracle-l
Received on Wed Aug 15 2007 - 19:03:13 CDT

Original text of this message

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