Posts
Showing posts from 2016
Oracle Data Function Example - Trunc,add_months,Next_day ets
- Get link
- X
- Other Apps
--1. FIRST DAY OF PRESENT YAER select to_char(trunc(sysdate,'yyyy'),'day') from dual; --2. Next year first day select to_char (add_months(trunc(sysdate,'yyyy'),12),'day') from dual; --3. next year first monday date. select next_day(add_months(trunc(sysdate,'yyyy'),12),'monday') from dual; --4. FIRST DAY OF THE CURRENT WEEK (IT ALWAYS STARTS WITH SUNDAY) select trunc(sysdate) from dual; --5. FIRST DAY OF THE NEXT WEEK select trunc(sysdate)+ 7 from dual; --6. FIRST DAY OF THE PREVIOUS WEEK select trunc(sysdate - 7 ) from dual; --7. FIRST DAY OF THE NEXT MONTH select to_char(add_months ( trunc(sysdate,'Mon'),1),'day') from dual; --8. FIRST DAY OF THE PREVIOUS MONTH select to_char(add_months ( trunc(sysdate,'Mon'),-1),'day') from dual; --9. LAST DAY OF THE PREVIOUS MONTH select to_char(trunc(sysdate,'Mon')-1,'day') from dual; --10. First day of the current ...
Exceptions and types
- Get link
- X
- Other Apps
Exceptions: Error occurring at run time is to handle the error is called exception. Warring or error code is called an exception. Exceptions can be internally defined (by the run-time system) or user defined 1. internally defined exceptions 2. user defined exceptions Internally Defined Exceptions: common internal exceptions have predefined names, such as ZERO_DIVIDE and STORAGE_ERROR. The other internal exceptions can be given names. Predefined PL/SQL Exceptions: An internal exception is raised implicitly whenever your PL/SQL program violates an Oracle rule. Exception Oracle Error SQLCODE Value ACCESS_INTO_NULL ORA-06530 -6530 CASE_NOT_FOUND ORA-06592 -6592 COLLECTION_IS_NULL ORA-06531 -6531 CURSOR_ALREADY_OPEN ORA-06511 -6511 D...