Page 1 of 1

oracle identifier problem

PostPosted: Wed Mar 05, 2014 7:00 am
by king
Oracle limits the length of database identifiers(tables,columns,ets) to 30 characters.I have found QXOrm auto generate SQL columns identifiers by adding table name , column name and some tag,however it is easily over 30 characters.Is there any idea to deal with the problem? Or I have to limit the length of the table name and column name in DB? Wish to hear from u!Thanks.

Re: oracle identifier problem

PostPosted: Wed Mar 05, 2014 8:12 am
by qxorm
Hi,

I didn't know this Oracle limitation : the error message is "ORA-00972: identifier is too long", isn't it ?
I tried to find a solution to bypass it but it seems that there is no way.

You can try to use the method qx::IxDataMember::setSqlAlias() when you register your class in your qx::register_class<T>() function.
The SQL alias provided by this method will be used in SQL queries instead of building a column identifier appending table + column + index.

Or another solution (certainly a better solution) would be to rename your tables and columns with shorter names.

Re: oracle identifier problem

PostPosted: Thu Mar 06, 2014 12:50 am
by king
Thanks a lot,using setSqlAlias has solved my problem. It seems that ODB has just the same problem,and it give the similar idea. Thanks again. :D
qxorm wrote:Hi,

I didn't know this Oracle limitation : the error message is "ORA-00972: identifier is too long", isn't it ?
I tried to find a solution to bypass it but it seems that there is no way.

You can try to use the method qx::IxDataMember::setSqlAlias() when you register your class in your qx::register_class<T>() function.
The SQL alias provided by this method will be used in SQL queries instead of building a column identifier appending table + column + index.

Or another solution (certainly a better solution) would be to rename your tables and columns with shorter names.

Re: oracle identifier problem

PostPosted: Thu Mar 06, 2014 8:12 am
by qxorm
Thanks a lot,using setSqlAlias has solved my problem.

Great !