Month: December 2016

  • Display List of All Views on Oracle Database

    Oracle Views These are queries that you can used to display the views on Oracle. ALL_VIEWS describes the views accessible by logged user. select * from all_views DBS_VIEWS describes all views however you need DBA priviledges for this query. select *  from dba_views USER_VIEWS describes the views owned by logged user. select *  from user_views Also you…

  • Encrypt Text to MD5 on Oracle Database

    Encrypt MD5 First of all, you need to have access on DBMS_OBFUSCATION_TOOLKIT since it enables an application to encrypt data using either the Data Encryption Standard (DES) or the Triple DES algorithms. Here is the example how to encrypt text to MD5 on Oracle Database. First create the function called ENCRYPTMD5 and execute it later in order to…

  • Calculate Duration from Date on Oracle Database

    Calculate Duration Here is the example query to calculate duration in hour : select (to_date(‘2016-12-06 22:00’, ‘YYYY-MM-DD hh24:mi’) – to_date(‘2016-12-06 19:30’, ‘YYYY-MM-DD hh24:mi’)) * 24 duration_hours        from dual; Result in minute : select (to_date(‘2016-12-06 22:00’, ‘YYYY-MM-DD hh24:mi’) – to_date(‘2016-12-06 19:30’, ‘YYYY-MM-DD hh24:mi’)) * 24 * 60 duration_minutes        from dual; Result in second :…

  • ALL_SOURCE: Show the Source Stored Procedure/ Function, Trigger, etc on Oracle Database

    Oracle all_source These are the query to display the source for an Oracle stored procedure/ function, trigger, etc : all_source describes the text source of the stored objects accessible to the current user. select * from all_source; user_source describes the text source of the stored objects owned by the current user. select * from user_source; Here is the…