X-Original-To: pgsql-sql-postgresql.org@localhost.postgresql.org Received: from localhost (unknown [200.46.204.144]) by svr1.postgresql.org (Postfix) with ESMTP id 09C8052882 for ; Thu, 19 May 2005 06:11:55 -0300 (ADT) Received: from svr1.postgresql.org ([200.46.204.71]) by localhost (av.hub.org [200.46.204.144]) (amavisd-new, port 10024) with ESMTP id 63599-07 for ; Thu, 19 May 2005 09:11:46 +0000 (GMT) Received: from mx-00.sil.at (mx-00.sil.at [62.116.68.196]) by svr1.postgresql.org (Postfix) with ESMTP id 9CC5652802 for ; Thu, 19 May 2005 06:11:44 -0300 (ADT) Received: (qmail-ldap/ctrl 36393 invoked from network); 19 May 2005 09:11:51 -0000 Received: from unknown (HELO jupiter.sonorys.at) ([213.235.243.42]) (envelope-sender ) by mx-00.sil.at (qmail-ldap-1.03) with SMTP for ; 19 May 2005 09:11:51 -0000 Received: from neptun.sonorys.at (neptun.sonorys.at [172.24.1.17]) by jupiter.sonorys.at (8.11.7+Sun/8.11.7) with ESMTP id j4J9Bp109638; Thu, 19 May 2005 11:11:51 +0200 (MEST) Received: by neptun.sonorys.at with Internet Mail Service (5.5.2653.19) id <2JD5W4G1>; Thu, 19 May 2005 11:11:51 +0200 Message-ID: From: =?ISO-8859-1?Q?K=D6PFERL_Robert?= To: "'bandeng'" , pgsql-sql@postgresql.org Subject: Re: postgre variable Date: Thu, 19 May 2005 11:11:48 +0200 MIME-Version: 1.0 X-Mailer: Internet Mail Service (5.5.2653.19) Content-Type: text/plain; charset="ISO-8859-1" X-Virus-Scanned: by amavisd-new at hub.org X-Archive-Number: 200505/162 X-Sequence-Number: 21475 You should considder a variation as Volkan suggested. Otherwise the EXECUTE command might be what you are looking for. Execute a sql made up in a string |-----Original Message----- |From: bandeng [mailto:postgredb@gmail.com] |Sent: Donnerstag, 19. Mai 2005 04:11 |To: pgsql-sql@postgresql.org |Subject: [SQL] postgre variable | | |hello all, | |i want to make dynamic sql query like this | |select * from tb_cust where name='erick' and age='20' | |to | |select * from tb_cust $1 | |i have tried but error comeup | |any suggestion? | |thanks |Ricky |-- |Gutten Aben Sugeng Sonten, Jangane Kurang Santen |bandeng.................... | |---------------------------(end of |broadcast)--------------------------- |TIP 9: the planner will ignore your desire to choose an index |scan if your | joining column's datatypes do not match |