Re: SQL query

From: TurkBear <johng_at_nospam.mm.com>
Date: 1999/04/08
Message-ID: <370df2f8.9159029_at_news.dot.state.mn.us>#1/1


Try this:

insert into USERICONS(usercode,sequenceno,bitmapint,trancode,description) select(select usercode from USERROLES where rolecode = 'ST') usercode,sequenceno,bitmapint,trancode,description from USERICONS where usercode = 'st'

Note: I have not tried this use of an inline subquery, so this is a 'theorectical' solution....please test on non-important data ----

Perhaps Tom Kyte will respond with a better way....

gcb45_at_dial.pipex.com wrote:

--------------snip-------------------------------

>I have a user called 'st' which has 19 icons. I would like to be able
>to give all users with the rolecode ST the same icons that 'st' has.
>This is where I hit a problem.
>
>If there was one user I would use the following SQL:
>insert into usericons (usercode, sequenceno, bitmapint, trancode,
>description)
>(select '&usercode', sequenceno, bitmapint, trancode, description
>from USERICONS
>where usercode = 'st');
>

 ----------------------snip----------------------

>
>thanks
>Gary

To reply please remove the 'nospam' part of the address Received on Thu Apr 08 1999 - 00:00:00 CEST

Original text of this message