openjpa-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Craig L Russell <Craig.Russ...@Sun.COM>
Subject Re: Valid table/column names
Date Sat, 09 May 2009 02:52:35 GMT
Hi Tim,

Yes, if quoting is legal, then my preferred solution is that quoting  
reserved word names should be the default treatment.


On May 8, 2009, at 6:59 PM, Tim McConnell wrote:

> Hi, I'm wondering if anyone recalls the rationale for making table  
> and/or column names valid by appending number(s) to the end of the  
> name (i.e., DATE --> DATE0, TIME--> TIME1) ??  I ask for a number of  
> reasons. Primarily I'm just trying to understand, but many of the  
> SLQ92 reserved words/keys in the sql-keywords.rscs file can be, and  
> are used, as valid column names. For example, NAME, VALUE, and  
> NUMBER are SQL92 reserved keywords, but they're frequently used as  
> valid column names without being converted to NAME0, VALUE0, or  
> So, this mechanism for creating valid column names by appending  
> numbers when reserved keywords are involved doesn't seem to be  
> uniformly applied, or at least it's not obvious to me. Finally, many  
> of the major database products (e.g., DB2, Oracle) support the usage  
> of reserved keywords if they are explicitly enclosed in double  
> quotes (e.g., "TIMESTAMP", "DATE", "TIME"). I wonder if it might be  
> more intuitive and less problematic to utilize this technique when  
> the database supports it ??
> -- 
> Thanks,
> Tim McConnell

Craig L Russell
Architect, Sun Java Enterprise System
408 276-5638
P.S. A good JDO? O, Gasp!

View raw message