Data Types exercise

Khaled Alkhudari
A free video tutorial from Khaled Alkhudari
Sr Oracle Developer/ Sr system analyst
4.5 instructor rating • 7 courses • 31,495 students

Learn more from the full course

Oracle PL/SQL is My Game: EXAM 1Z0-149

Become Oracle PL/SQL Developer / Covers ORACLE university track 100%. All the presentations & scripts are attached

21:51:49 of on-demand video • Updated January 2020

  • The full track of Oracle university Exam 1Z0-144 : Program with PL/SQL
  • Oracle Database 12c Architecture
  • Downloading and installing oracle database 12c in details
  • Overview of PLSQL
  • Declaring PLSQL Variables
  • Writing executable statements
  • Interacting with Oracle DB Server
  • Writing Control structure
  • Working with Composite Data Types
  • Using explicit cursors
  • Handling Exceptions
  • Creating Procedures
  • Creating Functions
  • Creating Packages
  • Working with Packages
  • Using oracle-supplied Packages in Application Development
  • Using dynamic SQL
  • Design consideration for PLSQL Code
  • Creating triggers
  • Creating Compound, DDL, and Event Database Triggers
  • Using the PLSQL Compiler
  • Managing PLSQL Code
  • Managing Dependencies
English [Auto] Hello everyone. Welcome. I hope that you are doing fine in the previous lessons. We took a lot of informations about that at a time. And I assume that you have a lot of informations about these data types. But anyway if you find yourself that you need some refreshment and some data types just send me and I will make a bonus sections for your concerns. OK. So anyway today we will take a very small example just to refresh your information about that data type. So let's start our lesson. So in this example I make that clear then begin then. And I define a variable the underscore and own number. I give it initial value of 300. Then I defined a variable v underscore that I give it a data type date. Then I make a variable called V underscore timestamp and I give it datatype time stamp. So the time stamp it is the same date but it contains the fractional seconds. I defined a variable called the underscore project underscore period and terrible year to month. This mean that this variable will hold a period containing the year and the month begin the underscore and equal one hundred twenty five dot. Three to three. So here I change the variable to this value. I give it initial value 300 at the beginning but here in the execution sections I give the underscore and or another value. So now the variable containing this value and forget the 300. OK. The underscore that equal says did. So here you can assign the variable function. So that is the return that says data from the system. And also here I put the underscore timestamp equal current underscore timestamp and the current underscore timestamp is a function that returned that current date and time for users Titians. Ok then I make the underscore project underscore period equal 0 3 dash 0 4. This mean three years and four months. OK. Very nice. Then I will add that the underscore. And then I would argue that we did then all of but that the underscore timestamp then I will add but that project period is concatenate. This is a good information you should know. So the project period is concatenated with the underscore project underscore period. I would execute this block and you will find Here's the result. So let's address the result and the first line I bent the V underscore I no and the and all containing this value. So you will see 125 do it 3 2 3 then I put that the date and the that is 27 September 2017. Then I print the V underscore timestamp. You will find 27 September 2017. Then here you will find the hours the minutes the seconds and the fraction of a second. So this is the time stamp and you can find here that it containing six digits fractional because the default is six. And at the end DBMSs and Scott are but the boot line. The project period is three dash four. And here you will find the plus sign. This means it is a positive Bill. Another important note that says did all of your containing the hours and the minutes and the seconds if you want to show this information you should use two card functions. Right. It's very simple and easy. Let's do it to. This date then I will make for example DD m m y y y y then h h then M then S S and I will close the function and I will close the brackets for that d be a must underscore Outwood then semicolon like this. I will execute again and you will find it is the result. Twenty seven September 2017 at 8:00. Thirty one minutes and four seconds. That's it. So in this lesson we understand many things. We understand the time stamp we understand the interval years to month. We understand that we can give initial value for the variable then we can change it in the execution section. We understand how we can use function inside the variables. So in this case I assigned that we did our function and I also used to count functions inside the DBMS and those are both. And also you can get that operator. So I think this is good information to know. And this lesson thank you for listening and see you in the next video.