From: Guy Fraser <guy@incentre.net>
To: pgsql-sql@postgresql.org
Subject: Re: What this parser mean?
Date: Mon, 24 Mar 2003 08:56:15 -0700
Message-ID: <3E7F2A9F.6000305@incentre.net> (raw)
References: <3E7A7D32.4A3E8E8C@mimos.my>
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
>
>
>
>
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients using the --to and --cc options:
reply via email
To: pgsql-sql@postgresql.org
Cc: guy@incentre.net
Subject: Re: What this parser mean?
In-Reply-To: <3E7F2A9F.6000305@incentre.net>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox