Академический Документы
Профессиональный Документы
Культура Документы
OLEH :
Syahfiar Dhani A 2103171028
In practice 2-2, you are introduced to the basic functionality of the SQL Developer
debugger:
Note: If you missed a step in a practice, please run the appropriate solution script for that
practice step before proceeding to the next step or next practice.
In this practice, you create, compile, and use stored functions and a procedure.
1) Create and invoke the GET_JOB function to return a job title.
a) Create and compile a function called GET_JOB to return a job title.
b) Create a VARCHAR2 host variable called b_title, allowing a length of 35
characters. Invoke the function with job ID SA_REP to return the value in the
host variable, and then print the host variable to view the result.
Solution Practice 2 – 1
a)
b)
a)
c)
In this practice, you experiment with the basic functionality of the SQL Developer
debugger.
1) Enable SERVEROUTPUT.
6) Add four breakpoints to the emp_list procedure to the following lines of code:
a) OPEN emp_cursor;
b) WHILE (emp_cursor%FOUND) AND (i <= pMaxRows) LOOP
c) v_city := get_location (emp_record.department_name);
d) CLOSE emp_cursor;
10) Examine the value of the variables in the Data tab. What are the values assigned to
REC_EMP and EMP_TAB? Why?
11) Use the Step Into debug option to step into each line of code in emp_list and go
through the while loop once only.
16) If you use the Step Over debugger option to step through the code, do you step
through the get_location function? Why or why not?
Meskipun baris kode tempat breakpoint ketiga diatur berisi panggilan ke
fungsi get_location, Step Over (F8) mengeksekusi baris kode dan mengambil
nilai yang dikembalikan dari fungsi (sama seperti [F7]); Namun, kontrol tidak
ditransfer ke fungsi get_location.