X-Original-To: pgsql-sql@postgresql.org Received: from spampd.localdomain (postgresql.org [64.49.215.8]) by postgresql.org (Postfix) with ESMTP id 9A1CE47632C for ; Mon, 24 Mar 2003 10:56:13 -0500 (EST) Received: from bach.ccinet.ab.ca (bach.ccinet.ab.ca [198.161.96.1]) by postgresql.org (Postfix) with ESMTP id 62D5C476344 for ; Mon, 24 Mar 2003 10:56:11 -0500 (EST) Received: from incentre.net (squid.incentre.net [206.75.213.195]) by bach.ccinet.ab.ca (8.12.6/8.12.6) with ESMTP id h2OFugf7007762 for ; Mon, 24 Mar 2003 08:56:42 -0700 (MST) (envelope-from guy@incentre.net) Message-ID: <3E7F2A9F.6000305@incentre.net> Date: Mon, 24 Mar 2003 08:56:15 -0700 From: Guy Fraser User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.0.1) Gecko/20021003 X-Accept-Language: en MIME-Version: 1.0 To: pgsql-sql@postgresql.org Subject: Re: What this parser mean? References: <3E7A7D32.4A3E8E8C@mimos.my> Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit X-Spam-Status: No, hits=-35.6 required=5.0 tests=BAYES_01,EMAIL_ATTRIBUTION,QUOTED_EMAIL_TEXT,REFERENCES, REPLY_WITH_QUOTES,USER_AGENT_MOZILLA_UA autolearn=ham version=2.50 X-Spam-Level: X-Spam-Checker-Version: SpamAssassin 2.50 (1.173-2003-02-20-exp) X-Archive-Number: 200303/549 X-Sequence-Number: 12587 Hi FYI This line will not work in PostgreSQL 7.3 : + " limit " + recordPerpage + "," + beginRecord; Change it to : + " limit " + recordPerpage + " offset " + beginRecord; This works in pre PostgreSQL 7.3 versions as well. Guy Abdul Wahab Dahalan wrote: >I wrote a java program to query a data from 4 tables and the string >query is like: > >querydata ="select >bizfavorite.bizid,bizprofile.bizname,bizprofile.bizphone,bizprofile.bizfax,bizfavorite.searchtype," > > + "bizfavorite.keyword,to_char(bizfavorite.listdate,'DD-MM-YYYY') as >listdate,bizfavorite.offerid,offer.otype,offer.bizid as obizid," > + "to_char(offer.oposted_date,'DD-MM-YYYY') as >oposted_date,to_char(offer.oexpiry_date,'DD-MM-YYYY') as oexpiry_date," > + "userprofile.username,userprofile.ufullname,userprofile.uemail" > + " from bizfavorite join bizprofile using(bizid) join userprofile >using(bizid) left join offer using(offerid)" > + " where bizfavorite.username= ? and urole='1' order by listdate desc" > > + " limit " + recordPerpage + "," + beginRecord; > >When I run this query, I got this message : Message: ERROR: parser: >parse error at or near "-" > >but when I ran this query from psql command prompt its ok.I got what I >want. >b2bscm=> select >bizprofile.bizname,bizprofile.bizphone,bizprofile.bizfax,bizfavorite.searchtype,bizfavorite.keyword,to_char(bizfavorite.listdate,'DD-MM-YYYY') >as listdate,bizfavorite.offerid,offer.otype,offer.bizid as >obizid,to_char(offer.oposted_date,'DD-MM-YYYY') as >date,to_char(offer.oexpiry_date,'DD-MM-YYYY') as >oexpiry_date,userprofile.username,userprofile.ufullname,userprofile.uemail >from bizfavorite join bizprofile using(bizid) join userprofile >using(bizid) left join offer using(offerid) where bizfavorite.username= >'faiz' and urole='1' order by listdate desc limit 8,0; > >Any help, very much appreciated..Thanks > > >---------------------------(end of broadcast)--------------------------- >TIP 4: Don't 'kill -9' the postmaster > > > >