Re: Needs Function - Mailing list pgsql-sql

From Rodrigo De León
Subject Re: Needs Function
Date
Msg-id a55915760705030017g51ac2cb6icd01cf8f4fbeaf7e@mail.gmail.com
Whole thread Raw
In response to Needs Function  ("Penchalaiah P." <penchalaiahp@infics.com>)
Responses Re: Needs Function  ("Aaron Bono" <postgresql@aranya.com>)
List pgsql-sql
On 5/2/07, Penchalaiah P. <penchalaiahp@infics.com> wrote:
> I need a user defined function for the following purpose….
>
> If I pass a string with comma ( , ) separated chars/values…. It should be appear in next line…
>
> Ex: select get_sep_str ('SK, rp, h, j, 6, 9, kl') from dual;
>
> Output :
>
> SK
>
> rp
>
> h
>
> j
>
> 6
>
> 9
>
> kl
>
>
>
> (Or)
>
>
>
> I have one table like this…..
>
>
>
> Temp Table:
>
>
>
> Deptno number(10)
>
> Empno  varchar2(200);
>
>
>
> Data in temp table:
>
>
>
> Deptno                       Empno
>
> -----------                      ------------
>
> 10                                      B3091,B3092,B3093,B3085
>
> 11                                      3651,6521
>
> 12                                      H3062
>
>
>
> Now, I want to display the data like this…..
>
>
>
> Deptno                       Empno
>
> ---------                        ---------
>
> 10                   B3091
>
> 10                   B3092
>
> 10                   B3093
>
> 10                   B3094
>
> 11                   3651
>
> 11                   6521
>
> 12                   H3062
>
> Now, how can I achieve this….

See:

http://archives.postgresql.org/pgsql-general/2005-12/msg00080.php


pgsql-sql by date:

Previous
From: Tom Lane
Date:
Subject: Re: Dynamic prepare possible in plpgsql?
Next
From: "Aaron Bono"
Date:
Subject: Re: Needs Function