| From: | Joachim Wieland <joe(at)mcknight(dot)de> |
|---|---|
| To: | Poul Jensen <flyvholm(at)gfy(dot)ku(dot)dk> |
| Cc: | pgsql-general General <pgsql-general(at)postgresql(dot)org> |
| Subject: | Re: ECPG: non-integer constant in group by |
| Date: | 2006-09-15 17:18:46 |
| Message-ID: | 20060915171846.GA3835@mcknight.de |
| Views: | Whole Thread | Raw Message | Download mbox | Resend email |
| Thread: | |
| Lists: | pgsql-general |
On Fri, Sep 15, 2006 at 02:40:49AM -0800, Poul Jensen wrote:
> 1) It seems like the fastest way to find the # of distinct elements in a
> column is using GROUP BY. With ECPG, if I try
> EXEC SQL SELECT filenm FROM beamdata GROUP BY filenm;
> I will get "sql error Too few arguments". Why? Can I correct the
> query to avoid the error message? (sqlca.sqlerrd[2] does contain the #
> of elements in spite of error)
The problem is that you are selecting a value but you don't say where ecpg
should store the result. You're missing the "INTO :var" part.
Joachim
--
Joachim Wieland joe(at)mcknight(dot)de
GPG key available
| From | Date | Subject | |
|---|---|---|---|
| Next Message | Karen Hill | 2006-09-15 17:24:57 | [OT] PHP vs Postgresql argument on Slashdot's front page. |
| Previous Message | Robert Bernier | 2006-09-15 17:16:46 | Re: One of our own begins a new life |