Received: from chennai.transys (chennai.transys.net [12.33.140.105]) by postgresql.org (8.11.3/8.11.4) with ESMTP id g0DEZFB07254 for ; Sun, 13 Jan 2002 09:35:16 -0500 (EST) (envelope-from unnikrishnan.menon@chennai.transys.net) Received: from UNNIKRISHNAN ([192.168.10.233]) by chennai.transys with SMTP (Microsoft Exchange Internet Mail Service Version 5.5.2650.21) id CGH4YW2S; Sun, 13 Jan 2002 20:17:53 +0530 Message-ID: <008801c19c3f$d588ce70$e90aa8c0@UNNIKRISHNAN> From: "Unnikrishnan Menon" To: Subject: Problems with PL/PGSQL - functions Date: Sun, 13 Jan 2002 20:07:27 +0530 MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="----=_NextPart_000_0085_01C19C6D.EC299140" X-Priority: 3 X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook Express 5.50.4522.1200 X-MimeOLE: Produced By Microsoft MimeOLE V5.50.4522.1200 X-Archive-Number: 200201/107 X-Sequence-Number: 6196 This is a multi-part message in MIME format. ------=_NextPart_000_0085_01C19C6D.EC299140 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable Hi, I have a couple of problems : 1. I create a temporary table using the following method within a function: query :=3D ''Create table S_'' || nextval(sequence) || '' ( abc integer= , xyz varchar)''; Execute query; This query does create a table. But when I'am unable to access the reco= rds in the table. I use the following methods: =20=20=20=20 a. Select xyz into variable from S_''|| nextval(sequence)||'' where abc= =3D (some counter value) ; b. query1 :=3D '' Select xyz as variable from S_''|| nextval(sequence)|= |'' where abc =3D (some counter value) '' ; Execute query1; Both the queries do not give me the desired results. Could anyone sugge= st a way to get me the values. 2. What command or table gives the details of the constraints created other= than check constraints. 3. I'am using version 7.1.3. of PostgreSQL. Any idea whether any of the upc= oming versions supports the use of Execute for dynamic queries of Create ta= ble as... Select. Any help would be appreciated. Thanx in advance Unni ------=_NextPart_000_0085_01C19C6D.EC299140 Content-Type: text/html; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable
Hi,
 
I have a couple of problems :<= /DIV>
 
1. I create a temporary table using the fo= llowing=20 method within a function:
 
    query :=3D ''Create tab= le S_'' ||=20 nextval(sequence) || '' ( abc integer, xyz varchar)'';
    Execute query;
    This query does create = a table.=20 But when I'am unable to access the records in the table. I use the followin= g=20 methods:
   
    a. Select xyz into vari= able from=20 S_''|| nextval(sequence)||'' where abc =3D (some counter value) ;
    b. query1 :=3D '' Selec= t xyz as=20 variable from S_''|| nextval(sequence)||'' where abc =3D (some counter valu= e) ''=20 ;
        Exec= ute=20 query1;
 
    Both the queries do not= give me=20 the desired results. Could anyone suggest a way to get me the=20 values.
 
2. What command or table gives the details= of the=20 constraints created other than check constraints.
 
3. I'am using version 7.1.3. of PostgreSQL= . Any=20 idea whether any of the upcoming versions supports the use of=20 Execute for dynamic queries of Create table as... Select.
 
Any help would be appreciated.
 
Thanx in advance
 
Unni
 
 
 
------=_NextPart_000_0085_01C19C6D.EC299140--