openjpa-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Marc Prud'hommeaux <mprud...@apache.org>
Subject Re: Escaping reserved words in generated sql?
Date Thu, 16 Nov 2006 18:57:08 GMT

I'm amazed that I never knew that you could quote reserved column  
names. I just tested on Oracle, SQL Server, and Derby, and it seems  
to work for both of them.

Could you make an enhancement request at http://issues.apache.org/ 
jira/browse/OPENJPA so we can track this? It'd be a very useful  
feature to have.



On Nov 16, 2006, at 9:40 AM, Patrick Linskey wrote:

> We've historically always taken the approach of avoiding the word
> altogether, rather than escaping the word.
>
> It certainly wouldn't be difficult to modify DBDictionary to escape
> reserved words instead of avoiding them, though.
>
> -Patrick
>
> -- 
> Patrick Linskey
> BEA Systems, Inc.
>
> ______________________________________________________________________ 
> _
> Notice:  This email message, together with any attachments, may  
> contain
> information  of  BEA Systems,  Inc.,  its subsidiaries  and   
> affiliated
> entities,  that may be confidential,  proprietary,  copyrighted   
> and/or
> legally privileged, and is intended solely for the use of the  
> individual
> or entity named in this message. If you are not the intended  
> recipient,
> and have received this message in error, please immediately return  
> this
> by email and then delete it.
>
>> -----Original Message-----
>> From: roger.keays [mailto:roger.keays@ninthavenue.com.au]
>> Sent: Thursday, November 16, 2006 3:07 AM
>> To: open-jpa-dev@incubator.apache.org
>> Subject: Re: Escaping reserved words in generated sql?
>>
>>
>>
>> roger.keays wrote:
>>>
>>>  {prepstmnt 17689439 INSERT INTO FB_BLOBS (contentType,
>> filename, size)
>>> VALUES (?, ?, ?)
>>>
>>> If I execute the statement manually, quoting the "size"
>> token, it is okay.
>>>
>> Not the best example I suppose, since 'size' isn't in the
>> default oracle
>> DBdictionary. The following query, however, has the same
>> behaviour, even
>> though 'comment' is in the OracleDictionary:
>>
>> INSERT INTO FB_PRIVILEGES (comment, inheritable, level, role, type,
>> username, item_uuid) VALUES (?, ?, ?, ?, ?, ?, ?)
>>
>> -- 
>> View this message in context:
>> http://www.nabble.com/Escaping-reserved-words-in-generated-sql
>> --tf2642125.html#a7375647
>> Sent from the open-jpa-dev mailing list archive at Nabble.com.
>>
>>


Mime
View raw message