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

Home -> Community -> Usenet -> c.d.o.misc -> Update question

Update question

From: Phil Kaufman <philk_at_dbcsmartsoftware.com>
Date: Fri, 23 May 2003 11:46:07 -0400
Message-ID: <k1sza.219$hk1.67908696@mantis.golden.net>

Hi everyone,

This is for Oracle 8.0.5 (and above possibly).

When I attempt to write an update statement with the following syntax:

UPDATE <some table>

    SET <some column> = (SELECT 1 FROM DUAL) +

                            (SELECT 2 FROM DUAL)

/

I get an error:

    SET number_of_batches = (SELECT 1 FROM DUAL) +

                                                 *
ERROR at line 2:
ORA-00933: SQL command not properly ended

My question: How to have a single update contain two sub-select? I tried the idea of:

UPDATE <some table>

    SET <some column> = (SELECT tab1.col1 + tab2.col1

                             FROM (SELECT 1 AS col1 FROM DUAL tab1),
                            (SELECT 2 AS col1 FROM DUAL tab2)

/

but, no good, same error.

Anyone have any ideas?

Thanks very much in advance.

Phil Received on Fri May 23 2003 - 10:46:07 CDT

Original text of this message

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