Hmmm, the root of the problem is that we need to know the types of columns when creating a query plan. I'm not aware of any standard SQL way of doing that. If it's H2 specific, then using the CAST operator around the constant should give us enough information.
On 2016/02/12 11:55 PM, 'David Frese' via H2 Database wrote:
I did some more experiments: select 'Hello' as X => ok select ? as X => ok select X as Y from (select 'Hello' as X) => ok select X as Y from (select ? as X) => error "Unknown datatype X" Really surprising, and makes me curious about how a difference could be implemented there in the first place. Thanks Noel for pointing to TABLE as a workaround of that bug, but that's not an option for various reasons (multiple servers; generated sql strings). -- You received this message because you are subscribed to the Google Groups "H2 Database" group. To unsubscribe from this group and stop receiving emails from it, send an email to h2-database+unsubscr...@googlegroups.com <mailto:h2-database+unsubscr...@googlegroups.com>. To post to this group, send email to h2-database@googlegroups.com <mailto:h2-database@googlegroups.com>. Visit this group at https://groups.google.com/group/h2-database. For more options, visit https://groups.google.com/d/optout.
-- You received this message because you are subscribed to the Google Groups "H2 Database" group. To unsubscribe from this group and stop receiving emails from it, send an email to h2-database+unsubscr...@googlegroups.com. To post to this group, send email to h2-database@googlegroups.com. Visit this group at https://groups.google.com/group/h2-database. For more options, visit https://groups.google.com/d/optout.