Skip to main content

Posts

Showing posts from January, 2009

Oracle Tips

Here are some helpful tips to remember when dealing with oracle. I. Use the “flashback technology” when you accidentally commit a mistake with your production data. (altering entire table contents, corrupted table data, or worst dropping unintended table). - First thing to do is to enable flashback on your database. ALTER DATABASE FLASHBACK ON; - Restoring database to its good state. FLASHBACK DATABASE TO RESTORE POINT bef_damage; - Restoring dropped table. FLASHBACK TABLE [TABLE_NAME] TO BEFORE DROP; - Restoring table to its good state. FLASHBACK TABLE [TABLE_NAME] TO TIMESTAMP TO_TIMESTAMP('[DATE_TIME]'); II. Manipulate date and time display Aside from to_date and to_timestamp functions , you could also alter the date and time display in your database through the use of this code below. ALTER SESSION SET NLS_DATE_FORMAT = '[DATE_FORMAT]'

Oracle Split , Join , and DateDiff Functions

Split, Join and DateDiff are just few Oracle functions that can aid you in data manipulation. Function Definition Split - split a result by “character specified (by default, comma)” into multiple results. e.g. “A,B,C” –> results 3 records of “A”,”B”, and “C”. Join - join multiple records into one result by “character specified (by default, comma)”. e.g. “1″,”2″,”3″ –> results 1 record of “1,2,3″. DateDiff - Differentiate two dates. Function Code create or replace function split( p_list varchar2, p_del varchar2 := ',' ) return split_tbl pipelined is l_idx pls_integer; l_list varchar2(32767) := p_list; l_value varchar2(32767); begin loop l_idx := instr(l_list,p_del); ...

Re-blogging

This blog is active again with a fresh start, after i had trashed my previous blog i had come to my senses to re-create, focusing on technical and educational post and not mixing any petty stuffs. I am hoping to aid knowledge seekers specially students who need guide to do their homework. I will basically post all my technical experiences in IT and i am welcome for inquiries if my posts are not sufficient and need further explanations. I am not trying to be so diplomatic , in truth , i wish to keep my knowledge where i could access it online which will serve as a repertoire of all new and old techie things in IT. In turn it will refresh my memory every time i will visit my blog or if i need to re-use techniques, i do not have a good memory i admit . Cheers for my blog! Keep blogging!