From: | Trinath Somanchi <trinath(dot)somanchi(at)gmail(dot)com> |
---|---|
To: | Amar Dhole <adhole(at)tibco(dot)com> |
Cc: | pgsql-sql(at)postgresql(dot)org |
Subject: | Re: converting type and function in postgresql ? |
Date: | 2010-12-21 11:58:00 |
Message-ID: | AANLkTim0KH-xxk_hWxRzGLCDpn=aj-_FPVW-NGsoy2tE@mail.gmail.com |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-sql |
Try this
On Tue, Dec 21, 2010 at 5:03 PM, Amar Dhole <adhole(at)tibco(dot)com> wrote:
> Hi,
>
>
>
> I am new to postgesql.
>
>
>
> I have oracle type and function, which I needs to converting it into
> postgresql .
>
>
>
> I am using postgresql 9.x
>
>
>
> Type :
>
> CREATE OR REPLACE
>
> TYPE INST
>
> AS TABLE OF VARCHAR2(255)
>
>
>
> How this type can be written in postgresql ??
>
>
>
>
>
> Oracle Function:
>
>
>
> CREATE OR REPLACE function in_list ( p_string in varchar2 ) return INST
>
> as
>
> l_string long default p_string || ',';
>
> l_data INST := INST();
>
> n number;
>
> begin
>
> loop
>
> exit when l_string is null;
>
> n := instr( l_string, ',' );
>
> l_data.extend;
>
> l_data(l_data.count) := ltrim( rtrim( substr( l_string, 1, n-1 )
> ) );
>
> l_string := substr( l_string, n+1 );
>
> end loop;
>
>
>
> return l_data;
>
> end;
>
>
>
> how this function can be rewritten in postgresql ?
>
>
>
> your help will help me a lot.
>
>
>
> Thanks
> Amar
>
--
Regards,
----------------------------------------------
Trinath Somanchi,
From | Date | Subject | |
---|---|---|---|
Next Message | Achilleas Mantzios | 2010-12-21 12:04:48 | Re: data import |
Previous Message | Pavel Stehule | 2010-12-21 11:36:58 | Re: data import |