I have something similar to this in my Advantage database:-
drop table #test;
create table #test (x cichar(50));
insert into #test (x) values ('cheese');
insert into #test (x) values ('fromage');
insert into #test (x) values ('Queso');
select
t1.x t1_x,
t2.x t2_x
from
#test t1
inner join
(
select
'CHEESE' x // String literal will be of type VARCHARFOX
from
system.iota
) t2
on t1.x=t2.x
This gives me the message:-
poQuery: Error 7200: AQE Error: State = HY000; NativeError = 2213; [iAnywhere Solutions] [Advantage SQL Engine]Invalid comparison or operation on strings with different collations. ** Script error information: -- Location of error in the SQL statement is: 137 (line: 5 column: 1)
When I would like:-
t1_x t2_x
cheese CHEESE
This is because the 'CHEESE' string literal becomes type VARCHARFOX and the column in the temp table is of type cichar because I want case insensitive comparisons.
I can fix this instance by adding a "COLLATE ads_default_ci" to the comparison, however this is cumbersome and I can never remember the exact syntax of it.
I think I must be doing something fundamentally wrong with the column types or the configuration of the database, what's the elegant/right way to do this?