Plsql program for updating
Code Listing 2: Calls to SYSDATE and SYSTIMESTAMP and the returned values Because I have passed dates and time stamps to DBMS_OUTPUT.
PUT_LINE, Oracle Database implicitly converts them to strings, using the default format masks for the database or the session (as specified by the National Language Settings NLS_DATE_FORMAT parameter).
Unlike strings and numbers, dates are quite complicated: not only are they highly formatted data, but there are also many rules for determining valid values and valid calculations (leap days and years, daylight saving time changes, national and company holidays, date ranges, and so on).
Fortunately, Oracle Database and PL/SQL provide a set of true date and time datatypes that store both date and time information in a standard internal format, and they also have an extensive set of built-in functions for manipulating the date and time.
Question 1 Oracle Database provides a function for returning the date of the last day of the month.
A date is also a considerably more complex datatype than a string or a number.
It has multiple parts (year, month, day, hour, and so on), and there are many rules about what constitutes a valid date.
Provide the string and Oracle Database returns a date or a time stamp, using the default format mask for the session: You should not assume that the literal value you provide in your call to TO_DATE matches the default format. Instead, always provide a format mask when converting strings to dates, as in Date truncation.
Use the TRUNC built-in function to truncate a date to the specified unit of measure.