X-Original-To: pgsql-jdbc-postgresql.org@localhost.postgresql.org Received: from localhost (unknown [200.46.204.144]) by svr1.postgresql.org (Postfix) with ESMTP id CAF138BA183 for ; Tue, 15 Feb 2005 12:04:59 +0000 (GMT) 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 34818-01 for ; Tue, 15 Feb 2005 12:04:57 +0000 (GMT) Received: from wproxy.gmail.com (wproxy.gmail.com [64.233.184.200]) by svr1.postgresql.org (Postfix) with ESMTP id 1E3FD8BA176 for ; Tue, 15 Feb 2005 12:04:56 +0000 (GMT) Received: by wproxy.gmail.com with SMTP id 68so906330wri for ; Tue, 15 Feb 2005 04:04:56 -0800 (PST) DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=beta; d=gmail.com; h=received:message-id:date:from:reply-to:to:subject:cc:in-reply-to:mime-version:content-type:content-transfer-encoding:references; b=nkhbwso7VEti7QmwCwdT03hQKiXqhCxAKMlT/3fIb/OsDtBNwIHXKiloEzH2WJ5WMacJ2LMEOvGVDvYiDzZqjtNoosVcIa8Hk0EFlZTiM+bbPmyfXmDwJeT1NzuqD98Acc/eSq2IuJ3i/mPGG38ANJB6puYIMF1Mso1ppvOEwOo= Received: by 10.54.23.34 with SMTP id 34mr78164wrw; Tue, 15 Feb 2005 04:04:56 -0800 (PST) Received: by 10.54.31.32 with HTTP; Tue, 15 Feb 2005 04:04:56 -0800 (PST) Message-ID: <2989532e05021504045fc879fe@mail.gmail.com> Date: Tue, 15 Feb 2005 17:34:56 +0530 From: Antony Paul Reply-To: Antony Paul To: Oliver Jowett Subject: Re: Pass column name in preparedstatement Cc: pgsql-jdbc@postgresql.org In-Reply-To: <4211E2E1.4090506@opencloud.com> Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit References: <2989532e050215032031e9aeb8@mail.gmail.com> <4211E2E1.4090506@opencloud.com> X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, hits=0.544 tagged_above=0 required=5 tests=AWL, FROM_ENDS_IN_NUMS, RCVD_BY_IP X-Spam-Level: X-Archive-Number: 200502/109 X-Sequence-Number: 12289 In 7.3.3 is there any use in using PreparedStatement since the columns may change for each query. rgds Antony Paul On Wed, 16 Feb 2005 00:54:09 +1300, Oliver Jowett wrote: > Antony Paul wrote: > > Hi all, > > Is it possible to pass column name to a PreparedStatement as a > > parameter. > > No, you can only use parameter placeholders in places which the backend > grammar allows parameters (namely, in expressions). Column names aren't > one of those places. > > > Or should I use Statement. > > You can use either Statement or PreparedStatement so long as you insert > the column name into the SQL query string yourself before giving it to > the driver. > > -O >