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 LAA16479 for ; Wed, 1 Dec 1999 11:03:28 -0500 (EST) (envelope-from virgi@el-mundo.net) Received: by fw2.el-mundo.es; (8.8.8/1.3/10May95) id RAA31356; Wed, 1 Dec 1999 17:09:38 -0500 (EST) Received: from somewhere by smtpxd Received: from somewhere by smtpxd Date: Wed, 1 Dec 1999 17:04:23 +0100 From: Virgilio Sanz To: pgsql-sql@postgresql.org Subject: do queries from strings in pgplsql Message-ID: <19991201170423.E18860@el-mundo.net> Reply-To: Virgilio Sanz Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="ahP6B03r4gLOj5uD" 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. --ahP6B03r4gLOj5uD 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 it possible to execute a query stored into a string? I mean, something like: function test(text) as returns opaque as '=20 declare=20 v_weekday alias for $1;=20 s_qry text; rec record;=20 begin=20 s_qry =3D ''select field1,field2, '' || v_weekday || '' from t_diary'';=20 for rec in exec_sql(s_qry) loop -- ^ that is what I'm looking for... -- [do what is needed]=20 end loop;=20 end; ' language 'plpgsql'; Thanks in advance, Virgilio Sanz --=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 "Success covers a multitude of blunders." -- George Bernard Shaw --ahP6B03r4gLOj5uD Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.0.0 (GNU/Linux) Comment: For info see http://www.gnupg.org iD8DBQE4RUcHJNGQmt4aPwIRAtOoAJ0T9C1qbFB4RaM8lWUm8D3FZnX0GgCgpNrh hnNAFnFTMtx6cctX/r6eIkY= =BINH -----END PGP SIGNATURE----- --ahP6B03r4gLOj5uD--