On 2006-09-15, Poul Jensen <flyvholm@gfy.ku.dk> wrote:
> 2) The code below was meant to find the # of distinct elements for many
> columns, but fails with the message
> sql error 'non-integer constant in GROUP BY'
> thrown at the EXEC SQL EXECUTE statement. What is the problem?
> char dbnm[50], *stmt = "SELECT ? FROM beamdata GROUP BY ?;";
That statement is not legal - parameters can only be used to substitute
_data_, not identifiers or syntax.
You would have to interpolate the column name directly into the query
(remembering to quote it with "" if needed) rather than use a parameter
for it.
--
Andrew, Supernews
http://www.supernews.com - individual and corporate NNTP services