X-Original-To: pgsql-sql-postgresql.org@localhost.postgresql.org Received: from localhost (neptune.hub.org [200.46.204.2]) by svr1.postgresql.org (Postfix) with ESMTP id A2417D1C526 for ; Mon, 1 Dec 2003 12:04:20 +0000 (GMT) Received: from svr1.postgresql.org ([200.46.204.71]) by localhost (neptune.hub.org [200.46.204.2]) (amavisd-new, port 10024) with ESMTP id 90996-02 for ; Mon, 1 Dec 2003 08:03:52 -0400 (AST) Received: from smtp107.mail.sc5.yahoo.com (smtp107.mail.sc5.yahoo.com [66.163.169.227]) by svr1.postgresql.org (Postfix) with SMTP id 003EDD1B8B6 for ; Mon, 1 Dec 2003 08:03:48 -0400 (AST) Received: from ptil-138-190-chn.primus-india.net (HELO IVESIA67) (sgnerd@203.196.190.138 with login) by smtp-v1.mail.vip.sc5.yahoo.com with SMTP; 1 Dec 2003 12:03:49 -0000 Message-ID: <024a01c3b802$d9afac40$7502a8c0@hdsc.com> Reply-To: "Kumar" From: "Kumar" To: "psql" Subject: Concatenating multiple fetches into a single string Date: Mon, 1 Dec 2003 17:31:07 +0530 MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="----=_NextPart_000_0247_01C3B830.E73977F0" X-Priority: 3 X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook Express 6.00.2800.1158 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1165 X-Virus-Scanned: by amavisd-new at postgresql.org X-Spam-Status: No, hits=0.6 tagged_above=0.0 required=5.0 tests=HTML_30_40 X-Spam-Level: X-Archive-Number: 200312/2 X-Sequence-Number: 16168 This is a multi-part message in MIME format. ------=_NextPart_000_0247_01C3B830.E73977F0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable Dear Friends, I am doing a migration from SQL server to Postgres SQL. A simple select fet= ches the following names. select full_name FROM project_members where project_members.project_role_id= in (' + @p_res_ids + ') ;=20 Let us say if the results are=20 full_name --------------- David Postgres plpgsql I need to send the out put as David,Postgres,Plsql -- one string, concatena= tes the fetches from multiple rows. This was handled in SQL server with a c= ursor. Can this be handled only by sql manipulation or need to use cursors. If i u= se cursor in postgres, what is the equivalent of MS SQL Statement=20 WHILE @@FETCH_STATUS =3D 0. please shed some light pls. ------=_NextPart_000_0247_01C3B830.E73977F0 Content-Type: text/html; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable
Dear Friends,
 
I am doing a migration from SQL server to Postgres SQL.= A=20 simple select fetches the following names.
 
select full_name FROM project_members where=20 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 -- o= ne=20 string, concatenates the fetches from multiple rows. This was handled in SQ= L=20 server with a cursor.
 
Can this be handled only by sql manipulation or need to= use=20 cursors. If i use cursor in postgres, what is the equivalent of MS SQL Stat= ement=20
WHILE @@FETCH_STATUS =3D 0.
 
please shed some light pls.

------=_NextPart_000_0247_01C3B830.E73977F0--