X-Original-To: pgsql-sql@postgresql.org Received: from ozimelb03.ozicom.com (unknown [203.185.247.100]) by postgresql.org (Postfix) with ESMTP id 22DCD475AFF for ; Thu, 20 Mar 2003 21:52:54 -0500 (EST) content-class: urn:content-classes:message MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable Subject: Re: What this parser mean? X-MimeOLE: Produced By Microsoft Exchange V6.0.6249.0 Date: Fri, 21 Mar 2003 13:52:56 +1100 Message-ID: X-MS-Has-Attach: X-MS-TNEF-Correlator: Thread-Topic: [SQL] What this parser mean? Thread-Index: AcLvVDb6O++gFg1JS7qj/pgv5k+b0AAAG5Jg From: "David Witham" To: , X-Archive-Number: 200303/482 X-Sequence-Number: 12521 Hi Abdul, You may have lost the '' around the date specification in the to_char funct= ion when forming the string in Java. Before submitting the query, check the= contents of the query string to make sure you still have the '' marks. Regards, David Witham -----Original Message----- From: Abdul Wahab Dahalan [mailto:wahab@mimos.my] Sent: Friday, 21 March 2003 13:47 To: pgsql-sql@postgresql.org Subject: [SQL] What this parser mean? I wrote a java program to query a data from 4 tables and the string query is like: querydata =3D"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=3D ? and urole=3D'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=3D> select bizprofile.bizname,bizprofile.bizphone,bizprofile.bizfax,bizfavorite.search= type,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=3D 'faiz' and urole=3D'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