Alias uppercasing with Dapper

.net dapper oracle

Question

I have the following query performed over OracleConnection (latest odp.net.managed package).

const string sql = @"select MyCol, count(1) Count from T group by MyCol";

dynamic[] rows = DB.Query(sql).ToArray();

It runs fine, however resulting dynamics have second property named as COUNT. Why? How can I fix it?

Accepted Answer

Enclose your alias in double quotes and oracle preserves whatever the case you specify.

const string sql = @"select MyCol, count(1) ""Count"" from T group by MyCol";


Licensed under: CC-BY-SA with attribution
Not affiliated with Stack Overflow
Is this KB legal? Yes, learn why
Licensed under: CC-BY-SA with attribution
Not affiliated with Stack Overflow
Is this KB legal? Yes, learn why