Received: from localhost (postgresql.org [64.49.215.8]) by postgresql.org (Postfix) with ESMTP id 62AEC4759D0 for ; Mon, 19 Aug 2002 11:34:50 -0400 (EDT) Received: from gateway.idealcorp.com (66-192-27-146.gen.twtelecom.net [66.192.27.146]) by postgresql.org (Postfix) with ESMTP id B18204754A3 for ; Mon, 19 Aug 2002 11:34:49 -0400 (EDT) Received: from idealcorp.com (client07.office.ideal [192.168.1.17]) by gateway.idealcorp.com (8.12.3/8.12.3/Debian -4) with ESMTP id g7JFYslW009749 for ; Mon, 19 Aug 2002 11:34:54 -0400 Message-ID: <3D61101E.50709@idealcorp.com> Date: Mon, 19 Aug 2002 11:34:54 -0400 From: Michael Zouroudis User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:0.9.8) Gecko/20020204 X-Accept-Language: en-us MIME-Version: 1.0 To: pgsql-admin@postgresql.org Subject: need help with an insert statement Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit X-Virus-Scanned: by AMaViS new-20020517 X-Archive-Number: 200208/210 X-Sequence-Number: 5325 sorry if this becomes a little long, but i want to fully explain the problem. three tables; create table asset( asset_id serial primary key ); create table software( software_id serial primary key ); create table software_asset( asset_id integer not null software_id integer not null ); what i'm aiming for is to get a function that inserts into the software_asset table from the software table. i already have a working function on assets that inserts into software. when that happens, i need it to set off the function on software to insert into software_asset. here is the function i am having problems with; create function soft_asset() returns opaque as ' declare s software%ROWTYPE; a assets%ROWTYPE; sa software_asset%ROWTYPE; s_id integer; a_id integer; asset_id integer; x integer; begin select currval (''assets_asset_id_seq'') into x; select currval (''software_software_id_seq'') into s_id; raise notice ''last value = %'', x; raise notice ''last value = %'', s_id; insert into software_asset (software_id, asset_id) values (s_id, x); return null; end; create trigger now after insert or update on software for each row execute procedure soft_asset(); the error happens on the insert statement. if i comment that line out, it returns a value on the notice, but i can't figure out how to return that value. if anybody can, i would appreicate their help. thanks in advance, mike -- Mike Zouroudis Intern __________________________________________________ I.D.E.A.L. Technology Corporation - Orlando Office http://www.idealcorp.com - 407.999.9870 x14