composite type use in pl/gpsql

Поиск
Список
Период
Сортировка
От Little, Douglas
Тема composite type use in pl/gpsql
Дата
Msg-id 8585BA53443004458E0BAA6134C5A7FBAD0291BE@EGEXCMB01.oww.root.lcl
обсуждение исходный текст
Список pgsql-general

Merlin writes”

first, the way to do insert from composite type is like this:

 

insert into foo select (f).*;

 

if f is type of foo.  The actual error you're getting is probably….”

 

 

I gave this a try.  Still bumping into syntax errors

CREATE TYPE oww_mart_tbls.type_log_site_process AS

   (proc_id integer,

    proc_name character varying(500),

    step_id integer,

    step_desc character varying(2000),

    step_starttime timestamp without time zone,

    step_endtime timestamp without time zone,

    step_returncode character varying(500),

    activity_count integer,

    status_flag character varying(1),

    status_desc character varying(2000));

ALTER TYPE oww_mart_tbls.type_log_site_process

  OWNER TO gpadmin;

 

Create function …

DECLARE

    -- standard variables

    vSpReturn_code text;

    Logsp oww_mart_tbls.type_log_site_process%ROWTYPE;

…..

 

insert into oww_mart_tbls.log_site_process(proc_id, proc_name, step_id, step_desc, step_starttime, step_endtime, step_returncode, activity_count, status_flag, status_desc)

 select (logsp).*;

 

works.

Thanks for the help.

 

 

Doug Little

 

Sr. Data Warehouse Architect | Business Intelligence Architecture | Orbitz Worldwide

500 W. Madison, Suite 1000  Chicago IL 60661| Office 312.260.2588 | Fax 312.894.5164 | Cell 847-997-5741

Douglas.Little@orbitz.com

 Description: cid:image001.jpg@01CABEC8.D4980670  orbitz.com | ebookers.com | hotelclub.com | cheaptickets.com | ratestogo.com | asiahotels.com

 

Вложения

В списке pgsql-general по дате отправления:

Предыдущее
От: Bruce Momjian
Дата:
Сообщение: Re: ctid ranges
Следующее
От: Tom Lane
Дата:
Сообщение: Re: ctid ranges