pl/pgsql examples

Поиск
Список
Период
Сортировка
Искать

pl/pgsql examples

От:
Suresh Raja <suresh.rajaabc@gmail.com>
Дата:
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.

Cheers!
-SR

Re: pl/pgsql examples

От:
Adrian Klaver <adrian.klaver@aklaver.com>
Дата:
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 = 
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


Re: pl/pgsql examples

От:
Oliver Christina <oliveiros.cristina@gmail.com>
Дата:
Not Sure if you need pl/pgsql for that. 
A insert SELECT query will do if I am understanding what you want to do...

Best,
Oliver 

Sent from Oliver's iPhone

> On 21 Nov 2014, at 03:48 p.m., 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.
> 
> Cheers!
> -SR


FAQ