RE: SQL dummy

From: Igor Neyman <ineyman_at_perceptron.com>
Date: Fri, 6 Mar 2009 12:49:21 -0500
Message-ID: <F4C27E77F7A33E4CA98C19A9DC6722A2042645E4_at_EXCHANGE.corp.perceptron.com>



Lee,

You don't need "synonyms" in SELECT list, did you try this:  

INSERT INTO lr_build
 (

            num_build,
            task_type,
            task_name,
            task_status

 )
 SELECT v.num_build num_build,
            v.task_type,
            v.task_name,
            'N Started'

 FROM lr_task_stat v, leecvl c
 WHERE c.VARIABLE_VALUE = 'P'
   AND c.NUM_BUILD = v.num_build
   AND c.TASK_TYPE = v.TASK_TYPE
   AND c.TASK_NAME = v.TASK_NAME

   AND NOT EXISTS
   (SELECT 1 from lr_build b
     WHERE b.NUM_BUILD = c.NUM_BUILD
       AND b.TASK_TYPE = c.TASK_TYPE
       AND b.TASK_NAME = c.TASK_NAME);

Igor

> -----Original Message-----
> From: oracle-l-bounce_at_freelists.org
> [mailto:oracle-l-bounce_at_freelists.org] On Behalf Of Robertson
> Lee - lerobe
> Sent: Friday, March 06, 2009 12:45 PM
> To: Michael.Coll-Barth_at_VerizonWireless.com; oracle-l
> Subject: RE: SQL dummy
>
> Yep, tried this as well, its says that task_status is an
> ivalid identifier
>
>
> -----Original Message-----
> From: Michael.Coll-Barth_at_VerizonWireless.com
> [mailto:Michael.Coll-Barth_at_VerizonWireless.com]
> Sent: 06 March 2009 17:35
> To: Robertson Lee - lerobe; oracle-l
> Subject: RE: SQL dummy
>
>
>
> > From: Robertson Lee - lerobe
>
> > I realise I have to somehow pull the table values from the
> tables and
> > the literal from dual but I cannot figure out how.
>
> Why? You can always add a literal to your selct statement. Try this
> without the insert portion to test that it giv4es what you want.
>
> INSERT INTO lr_build
> (
> num_build,
> task_type,
> task_name,
> task_status
> )
> SELECT v.num_build num_build,
> v.task_type task_type,
> v.task_name task_name,
> 'N Started' task_status
> FROM lr_task_stat v, leecvl c
> WHERE c.VARIABLE_VALUE = 'P'
> AND c.NUM_BUILD = v.num_build
> AND c.TASK_TYPE = v.TASK_TYPE
> AND c.TASK_NAME = v.TASK_NAME
> AND NOT EXISTS
> (SELECT 1 from lr_build b
> WHERE b.NUM_BUILD = c.NUM_BUILD
> AND b.TASK_TYPE = c.TASK_TYPE
> AND b.TASK_NAME = c.TASK_NAME)
> ;
>
>
>
> The information contained in this message and any attachment
> may be proprietary, confidential, and privileged or subject
> to the work product doctrine and thus protected from
> disclosure. If the reader of this message is not the
> intended recipient, or an employee or agent responsible for
> delivering this message to the intended recipient, you are
> hereby notified that any dissemination, distribution or
> copying of this communication is strictly prohibited.
> If you have received this communication in error, please
> notify me immediately by replying to this message and
> deleting it and all copies and backups thereof. Thank you.
>
>
> **************************************************************
> ***********
> The information contained in this communication is
> confidential, is intended only for the use of the recipient
> named above, and may be legally privileged.
>
> If the reader of this message is not the intended recipient,
> you are hereby notified that any dissemination, distribution
> or copying of this communication is strictly prohibited.
>
> If you have received this communication in error, please
> resend this communication to the sender and delete the
> original message or any copy of it from your computer system.
>
> Thank you.
> **************************************************************
> ***********
>
> --
> http://www.freelists.org/webpage/oracle-l
>
>
>
>

--
http://www.freelists.org/webpage/oracle-l
Received on Fri Mar 06 2009 - 11:49:21 CST

Original text of this message