Hi all.
I'd like to do the following:

insert into t1
  values (
    'atextvalue',(
      insert into t2
        values ( 'somethingelse' )
        returning theserial
    )
  )
;

that is, I first insert data into t2 getting back the newly created 
serial values, then i insert this values in another table.
I get an error message:
ERROR:  syntax error at or near "into"
referring to thwe second inner "into".
Is there a way to do this?
The inner insert...returning should be the "expression" to be used in
the outer insert.
My objective is to create an SQL script to load some 20+ million 
records and avoiding function calls would save some time.

Thanks in advance.

-- 
Vincenzo Romano
--
Maybe Computer will never become as intelligent as Humans.
For sure they won't ever become so stupid. [VR-1988]

---------------------------(end of broadcast)---------------------------
TIP 1: if posting/reading through Usenet, please send an appropriate
       subscribe-nomail command to [EMAIL PROTECTED] so that your
       message can get through to the mailing list cleanly

Reply via email to