You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
From the perspective of the SQL standard, concatenation of types other than a string type would require an explicit cast, because the concatenation operator is only defined between strings (and between arrays).
Submitted by: @pavel-zotov
SQL> select true || 'aaa' from rdb$database;
CONCATENATION
TRUEaaa
(OK, expected)
SQL> select (true = true)|| 'aaa' from rdb$database;
Statement failed, SQLSTATE = 42000
Dynamic SQL Error
-SQL error code = -104
-Token unknown - line 1, column 21
-||
SQL> select (true is true)|| 'aaa' from rdb$database;
Statement failed, SQLSTATE = 42000
Dynamic SQL Error
-SQL error code = -104
-Token unknown - line 1, column 22
-||
SQL> select 'aaa' || true from rdb$database;
CONCATENATION
aaaTRUE
(OK, expected; note that here order of boolean and string is changed comparing with sample #1)
SQL> select 'aaa' || (true = true) from rdb$database;
Statement failed, SQLSTATE = 42000
Dynamic SQL Error
-SQL error code = -104
-Token unknown - line 1, column 23
-=
SQL> select 'aaa' || (true is true) from rdb$database;
Statement failed, SQLSTATE = 42000
Dynamic SQL Error
-SQL error code = -104
-Token unknown - line 1, column 23
-is
Commits: 5f6d20c 64fa7dc
The text was updated successfully, but these errors were encountered: