Showing posts with label sql. Show all posts
Showing posts with label sql. Show all posts

Friday, August 18, 2006

Yet another usefull oracle sql statement

Found another oracle sql statement that comes in handy, The following statement will list all tables that are owned by the myschemaName, along with some interesting facts about each table.

select * from all_tables
where owner = 'myshemaName';

Wednesday, July 12, 2006

Oracle Timestamp

Interesting note on using timestamps in Oracle. Trying to set a timestamp field (my_timestamp) by using the following sql will NOT work correctly:

update my_table
set my_timestamp = '01-JUL-2006'

This will end up setting the timestamp equal to July 1, 2020 and something. So, using the following sql will work,

update my_table
set my_timestamp = TO_TIMESTAMP ('01-jul-06 14:10:10.123000', 'DD-Mon-RR HH24:MI:SS.FF')

Not sure if this is due to some nls* settings or something, but don't have time to look into it.