Monday, April 04, 2011

Oracle goodies

To find what schema/owner a table belongs to:
select * from all_objects where object_name like 'ONIX_LOAD_MASTER';


JDBC IN Clause, can't use one ? to substitute several values:

In JDBC update message_contact set read_status = ? where message_id in (?)

If I want to do it for more than one value I have to do this
update message_contact set read_status = ? where message_id in (?, ?, ?,?)
then bind each ? with a param value.

http://forums.sun.com/thread.jspa?messageID=4014944

Convert date stored as milliseconds from 1970 to date/time format
select to_char(to_date('01-JAN-1970','DD-MON-YYYY') + ( start_time / (60 * 60 * 24 * 1000) ),'DD-MON-YYYY HH24:MI:SS') "New Date" from pjqrtz_triggers order by start_time desc
 

0 Comments:

Post a Comment

<< Home