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: SQL question

RE: SQL question

From: Mac Isaac, John <John_Mac_Isaac_at_standardaero.ca>
Date: Fri, 18 Jan 2002 14:20:32 -0800
Message-ID: <F001.003F44BE.20020118124030@fatcity.com>

try
INSERT INTO contacts c (cont_id,cont_contact_surname) (SELECT seq_cont.nextval,distinct delegated_person  FROM sierras
 WHERE delegated_person is not null and

               delegated_person <>c.cont_contact_surname)

> -----Original Message-----
> From: iashraf_at_csc.com [SMTP:iashraf_at_csc.com]
> Sent: Friday, January 18, 2002 11:51 AM
> To: Multiple recipients of list ORACLE-L
> Subject: SQL question
>
> Hi i am trying to insert records into a table by selectiog from table 2, i
> want to insert a sequence,, and the distinct values from table 1 but i get
> an error:
>
> Query used:
> INSERT INTO contacts (cont_id,cont_contact_surname)
> (SELECT seq_cont.nextval,distinct delegated_person
> FROM sierras
> WHERE delegated_person is not null)
>
> Error;
>
> select seq_cont.nextval,distinct delegated_person
> *
> ORA-00936: missing expression
>
> How can i modify the query to obtain the correct results
>
> cheers all.
>
> --
> Please see the official ORACLE-L FAQ: http://www.orafaq.com
> --
> Author:
> INET: iashraf_at_csc.com
>
> Fat City Network Services -- (858) 538-5051 FAX: (858) 538-5051
> San Diego, California -- Public Internet access / Mailing Lists
> --------------------------------------------------------------------
> To REMOVE yourself from this mailing list, send an E-Mail message
> to: ListGuru_at_fatcity.com (note EXACT spelling of 'ListGuru') and in
> the message BODY, include a line containing: UNSUB ORACLE-L
> (or the name of mailing list you want to be removed from). You may
> also send the HELP command for other information (like subscribing).

-- 
Please see the official ORACLE-L FAQ: http://www.orafaq.com
-- 
Author: Mac Isaac, John
  INET: John_Mac_Isaac_at_standardaero.ca

Fat City Network Services    -- (858) 538-5051  FAX: (858) 538-5051
San Diego, California        -- Public Internet access / Mailing Lists
--------------------------------------------------------------------
To REMOVE yourself from this mailing list, send an E-Mail message
to: ListGuru_at_fatcity.com (note EXACT spelling of 'ListGuru') and in
the message BODY, include a line containing: UNSUB ORACLE-L
(or the name of mailing list you want to be removed from).  You may
also send the HELP command for other information (like subscribing).
Received on Fri Jan 18 2002 - 16:20:32 CST

Original text of this message

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