I recently tried using Coalesce() to check existence of a column name.
SELECT DISTINCT COALESCE((SELECT 'AColumnThatDoesNotExist' FROM TD), -999)
FROM TD;
But, the SQL error code dominates? "no such column: AColumnThatDoesNotExist"
Had to resort to:
SELECT name FROM pragma_table_info('TD') WHERE name =
'AColumnThatDoesNotExist';
And oddly, pragma_table_info() fails below if the Table TD is unadorned?
SELECT name FROM pragma_table_info(TD) WHERE name =
'AColumnThatDoesNotExist';On Wed, Mar 11, 2020 at 2:20 PM Richard Hipp <[email protected]> wrote: > On 3/11/20, Hick Gunter <[email protected]> wrote: > > While ORACLE does state that COALESCE will short circuit, > > A similar problem was reported on a ticket here: > https://www.sqlite.org/src/tktview?name=3c9eadd2a6 (The problem > reported on that ticket might not seem to be the same at first glance, > but deep down they are both the same issue.) > > I have a patch to fix the problem on a branch > (https://www.sqlite.org/src/timeline?r=do-not-factor-functions) which > you can experiment with. More changes and analysis are needed prior to > landing on trunk. I cannot guarantee that such a landing will in fact > occur, though it seems more likely than not at this point. > > -- > D. Richard Hipp > [email protected] > _______________________________________________ > sqlite-users mailing list > [email protected] > http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users > _______________________________________________ sqlite-users mailing list [email protected] http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users

