pg.ddx.io  pgsql-sql@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Rodrigo De León <rdeleonp@gmail.com>
To: pgsql-sql@postgresql.org
Subject: Re: Needs Function
Date: Thu, 3 May 2007 02:17:21 -0500
Message-ID: <a55915760705030017g51ac2cb6icd01cf8f4fbeaf7e@mail.gmail.com> (raw)
In-Reply-To: <A70AE049E81A6A40879D5DC0AC8C38C908DCF67D@venus.infics.com>
References: <A70AE049E81A6A40879D5DC0AC8C38C908DCF67D@venus.infics.com>

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



view thread (5+ messages)  latest in thread

Message-ID: <a55915760705030017g51ac2cb6icd01cf8f4fbeaf7e@mail.gmail.com>
Permalink:  ../a55915760705030017g51ac2cb6icd01cf8f4fbeaf7e@mail.gmail.com/
Also on:    postgresql.org/message-id/a55915760705030017g51ac2cb6icd01cf8f4fbeaf7e@mail.gmail.com

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-sql@postgresql.org
  Cc: rdeleonp@gmail.com
  Subject: Re: Needs Function
  In-Reply-To: <a55915760705030017g51ac2cb6icd01cf8f4fbeaf7e@mail.gmail.com>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox