Re: Why do I get a fixed length type from literals in CASE

2017-03-20 Thread Julian Hyde
Per the SQL standard: * Character literals have type CHAR (not VARCHAR) * The type of a CASE statement is the most general type of any of its branches. * Spaces are trimmed from CHAR values before comparing them. So, if I compare the CHAR(8) value ‘non_aero ‘ with the CHAR(7) value ‘non_aero’ the

Why do I get a fixed length type from literals in CASE

2017-03-19 Thread Jess Balint
Hi, I'm trying to build a query based on an existing (parsed) SQL query. I'm parsing this query: select case room_name when 'Meeting room for Aeronautics' then 'is_aero' else 'not_aero' end room_category from meeting_rooms The RexNode, after SqlToRelConverter has the "is_aero"