Received: from fw2.el-mundo.es (mail.el-mundo.es [195.53.249.11]) by hub.org (8.9.3/8.9.3) with ESMTP id LAA54060 for ; Thu, 2 Dec 1999 11:10:57 -0500 (EST) (envelope-from virgi@el-mundo.net) Received: by fw2.el-mundo.es; (8.8.8/1.3/10May95) id QAA14078; Thu, 2 Dec 1999 16:22:07 -0500 (EST) Received: from somewhere by smtpxd Received: from somewhere by smtpxd Date: Thu, 2 Dec 1999 16:16:24 +0100 From: Virgilio Sanz To: pgsql-sql@postgresql.org Subject: PL/PgSQL: selects into strings Message-ID: <19991202161624.D1959@el-mundo.net> Reply-To: Virgilio Sanz Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="pZs/OQEoSSbxGlYw" X-Mailer: Mutt 1.0i X-Mailer: Mutt 1.0 (Linux 2.2.12 i686) X-Editor: Vim 5.3 X-DSA/ElGamal-KeyID: 0xDE1A3F02 X-Disclaimer: These are my opinions and does not represent my employee. --pZs/OQEoSSbxGlYw Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: quoted-printable Hi list, I'm just added to the list and I'm not sure whether the following is a FAQ or not possible. Anyway, here it goes: Is there a way to execute a query stored in a string? I mean, something like: function test(text) as returns opaque as ' declare v_weekday alias for $1; s_qry text; rec record; begin s_qry =3D ''select field1,field2, '' || v_weekday || '' from t_diary''; for rec in exec_sql(s_qry) -- ^ this is what I'm looking for... -- [do what is needed] loop end loop; end; ' language 'plpgsql'; Thanks in advance, Virgilio --=20 Virgilio Sanz vsanz@el-mundo.net virgilio.sanz@el-mundo.es Diario el Mundo en Internet http://www.el-mundo.es =20 Email me with "send key pub" on subject to get my public key =20 Kime's Law for the Reward of Meekness: Turning the other cheek merely ensures two bruised cheeks. --pZs/OQEoSSbxGlYw Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.0.0 (GNU/Linux) Comment: For info see http://www.gnupg.org iD8DBQE4Ro1IJNGQmt4aPwIRAtfKAKDZaPf0oXmT+fi7vCEgMVFdS2kYvwCcCU8g Jr0pYPjWmxD71urpiARYPrQ= =vZKX -----END PGP SIGNATURE----- --pZs/OQEoSSbxGlYw--