From: Kumar <sgnerd@yahoo.com.sg>
To: psql <pgsql-sql@postgresql.org>
Subject: Concatenating multiple fetches into a single string
Date: Mon, 1 Dec 2003 17:31:07 +0530
Message-ID: <024a01c3b802$d9afac40$7502a8c0@hdsc.com> (raw)
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.
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: sgnerd@yahoo.com.sg
Subject: Re: Concatenating multiple fetches into a single string
In-Reply-To: <024a01c3b802$d9afac40$7502a8c0@hdsc.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