Re: Problem with views

From: Alexander V. Lukyanov <lav_at_yars.free.net>
Date: 1995/12/14
Message-ID: <4apjqb$1mv_at_gemini.yars.free.net>#1/1


Guenter Gersdorf (G.Gersdorf_at_tu-bs.de) wrote:
: I create the following table and view and got an error:
 

: -----------------------------------------------------------------
: SQL> CREATE TABLE SST (
: 2 ID number default USERENV('SESSIONID') not null,
: 3 VAL number
: 4 );
: SQL> INSERT INTO SST (id, VAL) SELECT USERENV('SESSIONID'), SUM(VAL) FROM SST;
: INSERT INTO SST (id, VAL) SELECT USERENV('SESSIONID'), SUM(VAL) FROM SST
: *
: ERROR at line 1:
: ORA-00937: not a single-group group function
 

: SQL> --but this works:
: SQL> INSERT INTO SST (id, VAL) SELECT MIN(USERENV('SESSIONID')), SUM(VAL) FROM
: SST WHERE ID=USERENV('SESSIONID');
 
: 1 row created.

It seems that Oracle does not think USERENV('SESSIONID') is a constant.

---
Alexander Lukyanov
lav_at_video.yars.free.net
Received on Thu Dec 14 1995 - 00:00:00 CET

Original text of this message