Re: pl/pgsql examples - Mailing list pgsql-sql

From Adrian Klaver
Subject Re: pl/pgsql examples
Date
Msg-id 546F6161.6080606@aklaver.com
Whole thread Raw
In response to pl/pgsql examples  (Suresh Raja <suresh.rajaabc@gmail.com>)
List pgsql-sql
On 11/21/2014 07:48 AM, Suresh Raja wrote:
> Hi :
>
> i'm looking for pgsql functions to insert rows from a select query.  I'm
> new pgsql.  So please bear with me.  Can you share some sample code if
> you have. Or if you interested in writing the code, i can out source.

Could you provide some pseudo code outlining what is want to accomplish?

Say something like:

CREATE FUNCTION some_fnc()
SELECT fld_1, fld_2, fld_3 FROM some_table WHERE id = <some_parameter>
INSERT INTO another_table(fld1, fld2, fld3) VALUES(fld_1, fld_2, fld_3)

Obviously this a simple contrived example. The more detail you can 
provide, the better.

>
> Cheers!
> -SR


-- 
Adrian Klaver
adrian.klaver@aklaver.com



pgsql-sql by date:

Previous
From: Suresh Raja
Date:
Subject: pl/pgsql examples
Next
From: Oliver Christina
Date:
Subject: Re: pl/pgsql examples