Re: Help ! Storing value in temp variable
Date: 1995/07/08
Message-ID: <3tkjbh$g5l_at_news.nynexst.com>#1/1
Hi!
That isn't entirely true! See the following snippet:
SQL> col t new_value temp
SQL> select count(*) t from dual;
T
1
SQL> select &temp + 1 from dual;
old 1: select &temp + 1 from dual
new 1: select 1 + 1 from dual
1+1
2
Besides PL/SQL there is also SEQUENCE's to consider, as well as, the updating of the MAX'ed column! ;-}
I hope this helps!
Sincerely,
Martin Farber
Independent Oracle Consultant "A Jack of all trades and a slave to one."
| NYNEX Science & Technology | 500 Westchester Ave, Rm 1B-23 | White Plains, NY 10604 | ----------------- | email: farber_at_nynexst.com | Voice: 914/644-2656 | FAX: 914/644-2216
In article j0a_at_nz12.rz.uni-karlsruhe.de, Stefan Scheck <scheck_at_ask.uni-karlsruhe.de> () writes:
>Hi,
>
>if you want to use a temp-variable, you have to use PL/SQL.
>
>Easier:
>
>INSERT INTO MY_TABLE (MY_COLUMN)
>SELECT MAX(MY_COLUMN)+1 FROM MY_TABLE;
>
>Hope it helps.
>
>Greetings,
>Stefan Scheck.
>
Received on Sat Jul 08 1995 - 00:00:00 CEST