db-derby-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Kent Spaulding <k...@iotabits.com>
Subject Re: Derby/Oracle - single SQL query?
Date Thu, 05 Feb 2009 16:40:43 GMT
Yes, I only meant 'thanks for the pointer on how to implement  
functions in Derby, as that may be useful.'

Many of the of my pre-existing SQL queries use Oracle's decode(), so I  
may implement that, rather than rewrite the queries.

For Date types, {d ...} is fabulous.

MVH,
--Kent

On Feb 5, 2009, at 2:21 AM, Bernt M. Johnsen wrote:

>>>>>>>>>>>>> Kent Spaulding wrote (2009-02-04 12:47:15):
>> Thanks Bernt.
>>
>> That works in both DBs.
>>
>> For the rest of what I've discovered:
>>
>> Creating a to_date function also works.  Thanks for that too, as it
>> looks like I'll need one for decode() as well.[1]
>
> Why would you need such a function? A date column can be retrieved
> from result set with rs.getDate(n) and should work correctly on both
> databases. Date objects may be inserted with setDate() or as literals
> with the JDBC escape syntx {d '......'}. You should then not have to
> bother at all with how the different DB's have implemented this if
> they deviate from the SQL standard (like Oracle).
>
> -- 
> Bernt Marius Johnsen, Staff Engineer
> Database Technology Group, Sun Microsystems, Trondheim, Norway


Mime
View raw message