Please take this survey to help us learn more about how you use third party tools. Your input is greatly appreciated!

Error when using prepared statement through JDBC on some queries.

Hi, We're using vertica-jdk5-6.0.1-0.jar. We're trying to execute the following prepared statement with the right parameters: select rt.campaignid , c.name , timestampadd('hh', ?::int * floor(rt.hour / ?::int)::int,rt.date::timestamp) hourInterval , sum(rt.clicks) "clicks" , sum(sum(rt.clicks)) over(partition by rt.campaignid order by timestampadd('hh', ?::int * floor(rt.hour / ?::int)::int,rt.date::timestamp) asc rows between unbounded preceding and current row) "cumm. clicks" from admailtiser.rt_reports_dc rt join admailtiser.campaigns c on c.id = rt.campaignid group by rt.campaignid , c.name , timestampadd('hh', ?::int * floor(rt.hour / ?::int)::int,rt.date::timestamp) order by rt.campaignid , c.name , timestampadd('hh', ?::int * floor(rt.hour / ?::int)::int,rt.date::timestamp) We're getting an error that says we must use group by for the "rt.hour" and "rt.date" fields. When we execute the same query without prepared statement - it works just fine. It looks like a bug in the jdbc. Is there a fix for this? Is there a workaround we can use? Thanks, Asaf

Leave a Comment

BoldItalicStrikethroughOrdered listUnordered list
Emoji
Image
Align leftAlign centerAlign rightToggle HTML viewToggle full pageToggle lights
Drop image/file

Can't find what you're looking for? Search the Vertica Documentation, Knowledge Base, or Blog for more information.