Robert Read wrote:
>
> I am trying to run this statement with Informix 7.10:
>
> INSERT INTO a
> SELECT 1, b.* FROM b>
> B is view that is a join between table A and another. When
> this statement is run, I get this error:
>
> -360: Cannot modify table or view used in subquery.>
> Of course the text of the error is correct (the view _is_
> readonly), but I'm not updating the view, so why does it
> care?
>
> Of course there are workarounds, but is this a fug or a
> beature?
> This is ANSI SQL. The rule is that you cannot insert into a table you select
from. There are no conditions regarding whether the insert would "update the
view". That would involve continuous checking to insure that the insert was not
stuck in an endless loop. Insert into a temp table (with no log, if you want to
avoid some overhead), and then insert from the temp table into a.
--
-------------------------------------------------------------------------------
John Prideaux e-mail: alastl@ix.netcom.com Phone: (217)839-2121
Aladdin Steel, Inc. Fax: (217)839-4327
-------------------------------------------------------------------------------