.

Wednesday, March 27, 2019

Oracle :: essays research papers

Dates in Oracle are stored in numeral coif.Each encounter represents the century, year, month, day, hours, minutes, and seconds.The default view format is DD-MON-YY.Using the SYSDATE function, you foundation display the online date and clock.You bed drill SYSDATE as you would use any other column name.In order to view the time you will need to use the TO_CHAR function along with a format mask which includes a time format element.For example, you posterior display the catamenia date by selecting SYSDATE from a table.You usually select SYSDATE from a poop table called DUAL.All users can access the DUAL table.It is owned by the SYS user.It consists of unmatched column known as DUMMY, and one row with the valuate X.When you want to return a value - not necessarily a date - once only, the DUAL table is useful.To display the real date using the DUAL table, you use the command shown.And the output displays the current date.Dates are stored as patterns in the database, whic h enables you to perform arithmetical calculations on them.You can add or compute a number to or from a date for a resultant date value.You can figure one date from another to find the number of days among them.You can also add hours to a date and time value.This is performed by dividing the number of hours in the time value by 24.Lets take a attend to at how you can manipulate dates.Lets say that you want to add and subtract days from the current date.To add one hundred days to the current date, you type the command shown.The result is displayed in the column SYSDATE+100.If you want to subtract 34 days from the current date, you type the command shown.The result is displayed in the column SYSDATE-34.Lets say you want to subtract the hire date from the current date - you type the command shown.The result shows the number of days among the current date and the hire date.Lets say you want to display dates in terms of weeks.To show the number of weeks each employee in department 1 0 has worked, you first subtract the hiredate from the current date.Then you divide the result by seven.You can use date functions in a similar room to number functions to operate on Oracle dates.The MONTHS_BETWEEN function finds the number of months between two dates.The result is displayed as a numeric value.This is the only date function that does not return a date value.

No comments:

Post a Comment