views:

313

answers:

1

I need to reference a column called limit in a legacy oracle database and also use a SQLite in-memory database for unit testing. I have read to use backticks in the mapping files to accomplish this; limit which works fine in SQLite, but resolves to "limit" in oracle and barfs on the query.

Is this feature implemented correctly for oracle or am I missing something?

Cheers,

Rob

UPDATE

It seems the column wasn't created with quotes around it, but NHibernate recognises it as reserved and puts quotes round it :/

+1  A: 

Hi theGecko,

In Oracle you use double-quotes to reference objects with names as reserved words:

SQL> create table a (number number);

create table a (number number)
                ^
ORA-00904: : invalid identifier

"NUMBER" is a reserved word. However, you can:

SQL> create table a ("number" number);

Table created

SQL> select "number" from a;

    number
----------
Vincent Malgrat
Thanks for the reply, thats exactly how it is resolved in the query:SELECT payment."limit" as limit7_8_0_ from paymentwhich throws ORA-00904: "limit": invalid identifier :/
theGecko
Got it, see update :)
theGecko