Concatenating multiple fetches into a single string

From: "Kumar" <sgnerd(at)yahoo(dot)com(dot)sg>
To: "psql" <pgsql-sql(at)postgresql(dot)org>
Subject: Concatenating multiple fetches into a single string
Date: 2003-12-01 12:01:07
Message-ID: 024a01c3b802$d9afac40$7502a8c0@hdsc.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-sql

Dear Friends,

I am doing a migration from SQL server to Postgres SQL. A simple select fetches the following names.

select full_name FROM project_members where project_members.project_role_id in (' + @p_res_ids + ') ;

Let us say if the results are

full_name
---------------
David
Postgres
plpgsql

I need to send the out put as David,Postgres,Plsql -- one string, concatenates the fetches from multiple rows. This was handled in SQL server with a cursor.

Can this be handled only by sql manipulation or need to use cursors. If i use cursor in postgres, what is the equivalent of MS SQL Statement
WHILE @@FETCH_STATUS = 0.

please shed some light pls.

Responses

Browse pgsql-sql by date

  From Date Subject
Next Message Tomasz Myrta 2003-12-01 20:01:05 Re: Concatenating multiple fetches into a single string
Previous Message Richard Sydney-Smith 2003-12-01 04:41:52 Ooops ! :( Recovery techniques