14 videos 📅 2024-12-10 08:00:00 Asia/Brunei
12:04
2024-12-10 13:02:57
6:53
2024-12-10 13:18:23
3:49:58
2024-12-10 13:29:28
9:46
2024-12-11 07:45:15
5:40:21
2024-12-11 09:08:49
5:22
2024-12-11 17:54:14
1:42
2024-12-11 18:04:44
2:05:58
2024-12-12 09:00:08
1:01:06
2024-12-12 12:26:38
3:59
2024-12-12 15:09:36
51:24
2024-12-12 15:24:00
8:06
2024-12-12 16:34:52
2:35
2024-12-12 17:17:14
3:05
2024-12-12 17:26:54

Visit the ORACLE PL/SQL Fundamentals course recordings page

                WEBVTT

00:00:00.000 --> 00:00:02.040
yung one six seven or yung one six eight?

00:00:02.040 --> 00:00:03.180
One six eight po.

00:00:03.620 --> 00:00:05.000
Ah, isig. Thank you po.

00:00:12.760 --> 00:00:14.000
Connected na po lahat?

00:00:16.160 --> 00:00:18.420
Ah, yes po. Working on...

00:00:19.000 --> 00:00:19.400
Okay.

00:00:21.120 --> 00:00:22.620
Password? Ash blue?

00:00:24.180 --> 00:00:25.780
Mam teen? There you go.

00:00:30.000 --> 00:00:31.820
And can you click double...

00:00:31.820 --> 00:00:34.000
Can you double click the local, mam teen?

00:00:34.180 --> 00:00:35.240
Okay, yeah.

00:00:36.400 --> 00:00:37.200
And try the code.

00:00:39.020 --> 00:00:43.640
You can press control enter to run the code.

00:00:57.880 --> 00:00:59.000
Okay, see...

00:00:59.000 --> 00:01:02.000
Sir Ray already finished it.

00:01:29.900 --> 00:01:31.380
Sir Jerry, you're good?

00:01:32.020 --> 00:01:34.040
Is it running or you bump an issue?

00:01:35.760 --> 00:01:38.180
Sorry, ma. Working on kami dun sa clickboard, sir.

00:01:38.280 --> 00:01:38.860
Hindi mag-paste.

00:01:39.560 --> 00:01:40.440
Ay, mag-paste?

00:01:43.360 --> 00:01:46.360
Yung... Are you all using Windows or Mac?

00:01:47.120 --> 00:01:48.120
Windows po.

00:01:48.780 --> 00:01:49.380
Oh.

00:01:51.840 --> 00:01:52.860
Try po namin.

00:01:53.160 --> 00:01:53.660
Okay.

00:02:01.200 --> 00:02:03.000
Ayo pa rin mag-paste?

00:02:04.100 --> 00:02:05.920
Yun, may nakapag-paste na.

00:02:06.240 --> 00:02:08.540
Si Sir Joseph nakapag-paste na.

00:02:12.100 --> 00:02:15.000
Sir Joseph, try mo yung set server output on.

00:02:23.720 --> 00:02:26.400
Si Sir Miguel, hindi po nakapag-paste.

00:02:27.420 --> 00:02:29.200
Okay na si Sir Joseph.

00:02:32.900 --> 00:02:34.400
Sir Jerry okay na.

00:02:34.540 --> 00:02:35.400
Sir Ray okay na.

00:02:36.140 --> 00:02:36.800
Si mam teen.

00:02:36.920 --> 00:02:38.020
Okay ka na po, mam teen.

00:02:50.400 --> 00:02:52.280
Ma'am Christine, okay ka na po.

00:02:53.720 --> 00:02:54.920
Na try mo po.

00:02:59.860 --> 00:03:00.640
Okay.

00:03:06.080 --> 00:03:07.460
Ayun, nagdaluwa lang.

00:03:07.520 --> 00:03:08.620
Okay na Sir Miguel.

00:03:09.540 --> 00:03:10.060
Yan.

00:03:11.440 --> 00:03:11.980
Perfect.

00:03:13.980 --> 00:03:14.700
Okay na po.

00:03:15.180 --> 00:03:16.700
Awesome, awesome.

00:03:18.800 --> 00:03:20.280
Then yung for loop naman.

00:03:21.240 --> 00:03:22.400
So yung for loop natin.

00:03:24.170 --> 00:03:25.330
For counter.

00:03:27.710 --> 00:03:33.950
So the for loop in PLSQL provide a convenient way to execute a block of code a fixed number of times.

00:03:34.130 --> 00:03:41.670
It eliminates the need of explicit initialization, condition checking, and incrementing.

00:03:41.710 --> 00:03:44.450
Making it concise choice for fixed iteration.

00:03:45.270 --> 00:03:47.690
So let's explore the syntax and the example.

00:03:47.690 --> 00:03:55.710
So for counter in start value then dot dot then end value loop.

00:03:59.190 --> 00:04:00.910
So 169.

00:04:01.390 --> 00:04:05.310
Yeah let's try the 169 really quick.

00:04:06.250 --> 00:04:08.930
See if you're able to output the counter.

00:04:09.110 --> 00:04:13.690
Just copy paste it in our interactive tool sheet.

00:04:15.130 --> 00:04:16.750
The slides 169.

00:04:16.750 --> 00:04:20.930
You can click control enter to run it easily.

00:04:21.170 --> 00:04:23.590
Okay see Sir Miguel able to run the code.

00:04:24.190 --> 00:04:25.090
Awesome, okay.

00:04:25.310 --> 00:04:27.210
Yeah that's pretty easy.

00:04:30.170 --> 00:04:37.970
Then in PLSQL the while statement is used to repeat a block of code as long as the specified condition is true.

00:04:38.250 --> 00:04:42.030
So the while loops check the condition before each iteration.

00:04:42.910 --> 00:04:46.710
If the condition evaluates to true the loop execute.

00:04:48.010 --> 00:04:49.770
If false the loop stop.

00:04:50.530 --> 00:04:51.610
So the condition.

00:04:51.950 --> 00:04:55.750
So this is logical expression that evaluated before each loop iteration.

00:04:56.630 --> 00:05:03.750
The loop continues as long as this condition is true.

00:05:05.270 --> 00:05:08.630
Here's an example to demonstrate the while loop in this example.

00:05:08.630 --> 00:05:15.110
We use a counter variable to control the loop and print values from 1 to 5.

00:05:16.030 --> 00:05:23.690
So first we initialize the counter then in the condition check the loop check if the counter is greater than or equal to 5.

00:05:24.110 --> 00:05:32.650
Then the execution if it is true it prints a counter then loop exit if the condition will become false.

00:05:33.150 --> 00:05:37.230
The while loop will not execute if the condition is initially false.

00:05:37.950 --> 00:05:42.650
Again the while loop will not execute if the condition is initially false.

00:05:43.390 --> 00:05:51.230
Use the while loop when the number of iterations is not known in advance and depends on the condition that may change during the loop execution.

00:05:55.650 --> 00:05:58.170
So again we know the for loop.

00:05:58.270 --> 00:06:01.510
It's a control structure that allow you to execute a block of code.

00:06:01.510 --> 00:06:03.510
So we need a loop variable.

00:06:04.210 --> 00:06:07.970
So a variable that takes on each value in the specified range.

00:06:08.710 --> 00:06:10.910
Starting from start value and end value.

00:06:11.890 --> 00:06:17.330
You can also use reverse to iterate from a higher value down to a lower.

00:06:17.730 --> 00:06:26.450
So in this example we initialize the for loop initialize the counter variable to 1.

00:06:26.970 --> 00:06:28.210
Then we iterate.

00:06:28.210 --> 00:06:32.090
So printing currently of the counter in each iteration.

00:06:32.590 --> 00:06:36.210
So the variable counter automatically increment after each loop.

00:06:40.990 --> 00:06:50.210
So you can use reverse keyword to iterate in the opposite direction from a higher to a lower value.

00:06:50.830 --> 00:06:56.170
So in the example counter start 5 and decrements down to 1.

00:06:57.030 --> 00:06:58.890
So use reverse.

00:06:59.990 --> 00:07:09.170
So in PLSQL the go to statements allow you to transfer control unconditionally to a labeled section of code within the same block.

00:07:09.830 --> 00:07:16.770
This can be useful in certain cases such as breaking out of deeply nested loops or by passing parts of the code.

00:07:16.770 --> 00:07:26.090
However, the use of go to is generally discouraged in structural programming because it can make code harder to read and maintain.

00:07:27.730 --> 00:07:30.270
So we say go to label name.

00:07:30.490 --> 00:07:38.430
Label name, this is the identifier of the label you want to jump to labels must be declared within the same block as the go to statement.

00:07:39.430 --> 00:07:51.430
So labels are identified followed by a colon and can be placed any PLSQL statement to mark it as a target for go to.

00:07:54.890 --> 00:08:02.270
So here's an example using the go to statement with labels.

00:08:02.270 --> 00:08:07.270
So can you try that in your, that is slide 174.

00:08:07.930 --> 00:08:08.850
Can you try it now?

00:08:09.590 --> 00:08:13.510
So while you're trying, so I'm gonna explain the label declaration.

00:08:14.310 --> 00:08:20.350
So two labels start loop and end loop are declared within the declare section.

00:08:21.070 --> 00:08:26.070
So loop execution, the loop increments counter and checks if it is greater than 5.

00:08:26.070 --> 00:08:34.770
Then the go to statement, when counter exceed 5, the go to statement transfer control to the end loop label.

00:08:35.550 --> 00:08:36.810
It's keeping the rest of the loop.

00:08:37.630 --> 00:08:45.270
The exit after go to end loop as executed, control jumps directly to the line after the end loop.

00:08:45.550 --> 00:08:47.970
Printing the message, exiting the loop.

00:08:48.590 --> 00:08:53.990
So our key points is use sparingly, meaning okay yung magpaka-addict sa go to.

00:08:54.310 --> 00:08:58.810
Go to should be used sparingly as it can lead to code that is difficult to follow.

00:08:59.030 --> 00:09:08.250
Kasi nga, it can jump to that label and the person who will follow the code needs to jump to that code.

00:09:09.430 --> 00:09:12.350
Especially kapag nested na or andami ng code.

00:09:12.350 --> 00:09:18.570
So labels are local. Labels can only be used with the same PLS code block where they're declared.

00:09:19.330 --> 00:09:22.330
Readability, relying heavily on go to can reduce readability.

00:09:23.090 --> 00:09:28.410
So it's best reserved for specific cases where alternative logic might be more complex.

00:09:29.650 --> 00:09:33.350
Are you able to run the script on slide 174?

00:09:38.930 --> 00:09:41.050
This one, I highlighted it.

00:09:59.350 --> 00:10:03.850
Let me know if you're able to see to run it.

00:10:04.270 --> 00:10:05.690
I think all good.

00:10:05.690 --> 00:10:08.690
Mam tin, you can run that.

00:10:16.650 --> 00:10:21.370
Again, you can press control enter to run any time the code.

00:10:24.170 --> 00:10:26.330
I see sir Jerry able to run the code.

00:10:42.350 --> 00:10:44.570
Sir Miguel has some issue.

00:10:46.210 --> 00:10:48.850
Okay, yeah, I see it now.

00:10:48.950 --> 00:10:49.870
Yeah, you can run.

00:10:50.330 --> 00:10:51.970
Thank you for playing with the code.

00:10:54.030 --> 00:10:55.790
Okay, so let's move on.

00:10:59.350 --> 00:11:00.610
So cursor.

00:11:01.690 --> 00:11:06.930
Error handling is done through exceptions which allow you to manage error gracefully.

00:11:07.870 --> 00:11:10.730
So let's discuss more in depth in cursor.

00:11:11.890 --> 00:11:16.030
So again, we studied the implicit and explicit cursor.

00:11:18.730 --> 00:11:24.930
So again, implicit cursor is automatically created in PLSQL whenever a select statement

00:11:24.930 --> 00:11:29.770
returns a single row or during insert, update, or delete operation.

00:11:30.130 --> 00:11:36.490
The key features of that is it's managed entirely by PLSQL so no explicit declaration is required.

00:11:37.390 --> 00:11:41.170
It simplifies operation where only one row is expected.

00:11:42.350 --> 00:11:53.690
Example of that is automatically handles row 33 in begin, update employee set salary equals salary plus 1000 where employee ID 101.

00:11:53.690 --> 00:12:01.190
Well, the explicit cursor is defined explicit by programmer to process multiple rows returned by select query.

00:12:02.070 --> 00:12:05.290
It provides greater control over querying process.

00:12:05.530 --> 00:12:11.930
It's allow operation like fetching rows one at a time enabling detailed row by row processing.

00:12:17.210 --> 00:12:22.170
So there are four steps of using the explicit cursor.

00:12:22.170 --> 00:12:24.930
First is we declare the cursor.

00:12:25.190 --> 00:12:29.630
So define the cursor and specify the SQL query it will execute.

00:12:30.250 --> 00:12:37.850
For example, cursor, then your cursor name is, then the query select or the select statement.

00:12:39.350 --> 00:12:41.150
Then next is open the cursor.

00:12:41.550 --> 00:12:43.990
So execute the query and set up the result.

00:12:44.950 --> 00:12:46.870
Then open the cursor name.

00:12:47.490 --> 00:12:51.470
So once we open the cursor name, we can fetch the rows.

00:12:52.270 --> 00:12:56.890
Fetch the cursor name retrieves one at a time into variables.

00:12:57.830 --> 00:13:02.230
So for example, we fetch cursor name into variable one, variable two.

00:13:02.530 --> 00:13:05.230
Then after once we open the cursor, we have to close it.

00:13:05.350 --> 00:13:10.030
Close the cursor, release the resources associated with the cursor.

00:13:11.030 --> 00:13:13.270
Then close the cursor name.

00:13:17.150 --> 00:13:22.190
So let's try the slide 178.

00:13:22.670 --> 00:13:27.750
So we have to run first, we have to add last name.

00:13:27.890 --> 00:13:29.670
I think because we don't have last name.

00:13:30.230 --> 00:13:34.570
So I put in 178, the alter table employees add last name.

00:13:34.850 --> 00:13:36.170
So please add last name.

00:13:36.530 --> 00:13:38.890
Then let's try to run the cursor.

00:13:40.570 --> 00:13:42.990
So it start from declare.

00:13:44.030 --> 00:13:48.970
So slide 178, please run the two query.

00:13:51.410 --> 00:13:53.090
First query is adding a last name.

00:13:53.650 --> 00:13:59.750
Second query is learning the cursor, employer cursor.

00:14:27.030 --> 00:14:32.170
So the explanation of that is we declare our employer cursor.

00:14:33.110 --> 00:14:38.870
It's declared to then after that we select the first name and last name from the employees table.

00:14:38.870 --> 00:14:42.390
Then we open the cursor using the open statement.

00:14:42.810 --> 00:14:45.250
Execute the SQL query and prepare the result set.

00:14:46.370 --> 00:14:47.490
Then we fetch the data.

00:14:47.690 --> 00:14:53.810
So the fetch statement retrieves each row into the first name and last name variables.

00:14:55.130 --> 00:14:59.270
The loop continues fetching rows until not found is true, meaning there are no more rows.

00:14:59.570 --> 00:15:04.230
So we close the cursor, the close statement, release the cursor and press up resources.

00:15:08.050 --> 00:15:09.950
Everyone, are you able to run the code?

00:15:11.150 --> 00:15:12.970
I can see some of you.

00:15:13.010 --> 00:15:15.470
Sir Miguel already run the code.

00:15:17.130 --> 00:15:18.750
As well Sir Jerry.

00:15:21.010 --> 00:15:21.950
Yeah, Mantine.

00:15:24.950 --> 00:15:25.490
Okay.

00:15:44.430 --> 00:15:47.850
Okay, so let's continue.

00:15:50.370 --> 00:15:52.030
So what are the cursor attributes?

00:15:53.670 --> 00:15:59.690
So PL SQL provides four key attributes per cursor that help you control in managing them.

00:15:59.870 --> 00:16:01.350
First is percent pound.

00:16:01.770 --> 00:16:04.210
It will return true if the last fetch returns zero.

00:16:04.210 --> 00:16:06.470
Otherwise false.

00:16:06.970 --> 00:16:12.670
Then percent not found returns true if the last fetch did not return a row.

00:16:13.090 --> 00:16:13.890
Otherwise false.

00:16:15.070 --> 00:16:18.570
Then percent row count returns the number of rows.

00:16:19.370 --> 00:16:20.170
Fetch so far.

00:16:20.710 --> 00:16:21.810
Then percent is open.

00:16:21.890 --> 00:16:24.370
Return true if the cursor is open.

00:16:25.030 --> 00:16:26.610
Otherwise false.

00:16:27.430 --> 00:16:28.390
So key points.

00:16:29.710 --> 00:16:31.430
So implicit versus explicit.

00:16:31.430 --> 00:16:34.170
Use implicit cursor for a single row operation.

00:16:34.830 --> 00:16:38.270
And explicit cursor when dealing with multi-row queries.

00:16:39.790 --> 00:16:45.230
Then explicit cursor offer more control over query execution and row handling.

00:16:46.130 --> 00:16:51.690
Then closing a cursor for efficiency when done is crucial to pre-up resources.

00:16:53.310 --> 00:16:56.710
So don't forget to close the cursor when you open it.

00:16:56.710 --> 00:16:58.390
So yeah.

00:17:02.570 --> 00:17:08.590
So cursor attributes provide more important information about the state of a cursor during execution.

00:17:09.390 --> 00:17:13.450
These attributes can be used with both implicit and explicit cursor.

00:17:14.070 --> 00:17:22.610
To help you to control the flow of operation, each cursor attribute returns a specific type of information helping to manage cursor effectively.

00:17:23.210 --> 00:17:26.590
Here are the four main cursor attributes na pinagalala nito.

00:17:26.810 --> 00:17:32.130
So found returns if the last fetch or your data manipulation language returned.

00:17:33.390 --> 00:17:37.110
Operation affected one or more rows otherwise it returned false.

00:17:38.050 --> 00:17:42.030
It's typically used after a fetch statement to check if rows are being returned.

00:17:42.930 --> 00:17:43.730
Yeah.

00:17:44.610 --> 00:17:52.470
Then cursor is PLS code commit built-in attributes that enhance their usability to provide additional control.

00:17:53.090 --> 00:17:57.370
Two key attribute is percent row count and percent open.

00:17:57.590 --> 00:18:00.930
So let's understand their functionality and usage.

00:18:01.670 --> 00:18:07.090
So percent row count returns the number of row fetch or affected by the cursor so far.

00:18:08.550 --> 00:18:13.890
It's useful for tracking row processing in loops after manipulation operation.

00:18:15.970 --> 00:18:21.030
Then is open is returned to if the cursor is currently open otherwise return false.

00:18:21.750 --> 00:18:26.310
Useful to check the cursor state before attempting operation like fetch or close.

00:18:28.750 --> 00:18:29.250
Okay.

00:18:30.010 --> 00:18:32.670
So again row count and is open.

00:18:33.670 --> 00:18:38.650
Our valuable attributes for enhancing control and debugging during cursor operation.

00:18:39.430 --> 00:18:42.870
Ensuring smooth and efficient program execution.

00:18:43.730 --> 00:18:46.730
So again that is the summary.

00:18:47.450 --> 00:18:54.570
So for the cursor percent pound, percent not pound and percent row count and percent is open.

00:18:56.010 --> 00:18:57.790
So what is the...

00:18:57.790 --> 00:19:01.970
So first we declare the cursor, we open the cursor, we fetch it.

00:19:01.970 --> 00:19:03.850
Then we close the cursor.

00:19:04.650 --> 00:19:08.190
So that's the step using the explicit cursor.

00:19:09.650 --> 00:19:11.150
Now let's try it in the code.

00:19:11.470 --> 00:19:15.630
Can you try the slide 184 please?

00:19:16.830 --> 00:19:18.130
See the step-by-step.

00:19:18.230 --> 00:19:19.870
I also put comment there.

00:19:20.530 --> 00:19:23.690
So you can see step one, we declare the cursor.

00:19:23.770 --> 00:19:28.390
Step two, we open the cursor.

00:19:53.530 --> 00:19:55.350
Let me know if you can run the script.

00:20:06.230 --> 00:20:06.970
Hello sir.

00:20:07.550 --> 00:20:08.410
Yes po.

00:20:09.770 --> 00:20:11.310
May tanong lang po.

00:20:11.590 --> 00:20:12.050
Yes po.

00:20:13.290 --> 00:20:17.250
Paano siya naging explicit na version versus noon saan saan?

00:20:17.390 --> 00:20:19.550
Ano yung difference na po?

00:20:19.950 --> 00:20:20.450
Ayan.

00:20:21.130 --> 00:20:23.970
So din declare natin yung employer cursor.

00:20:24.210 --> 00:20:27.030
So yung employer cursor on the line two.

00:20:27.530 --> 00:20:29.030
Tayo yung nag-define nun, di ba?

00:20:30.150 --> 00:20:30.510
Yes po.

00:20:30.510 --> 00:20:31.990
So hindi siya implicit.

00:20:32.130 --> 00:20:36.610
Meaning hindi siya yung built-in cursor ni PLSQL.

00:20:37.330 --> 00:20:42.330
So ang difference nun, as I explained a while ago, mas dynamic siya.

00:20:42.870 --> 00:20:45.910
And it will use in the multiple...

00:20:45.910 --> 00:20:47.810
We can declare multiple cursor.

00:20:48.330 --> 00:20:51.730
Tapos pwede natin magamit yung cursor na yun.

00:20:52.030 --> 00:20:54.210
O yung queer na yun.

00:20:54.310 --> 00:20:55.630
Kumagapang it's a variable.

00:20:58.450 --> 00:21:00.690
Yes, pwede mo siyang i-reuse.

00:21:01.010 --> 00:21:02.630
Pwede mo siyang i-open.

00:21:03.830 --> 00:21:08.190
Tapos sa loob nun pwede ka rin mag-open ng another cursor to use that data.

00:21:08.850 --> 00:21:12.110
So again, for example yung employer cursor natin,

00:21:12.290 --> 00:21:15.010
it holds the first name and last name of employees.

00:21:15.510 --> 00:21:16.690
Kasi yun yung query natin.

00:21:17.210 --> 00:21:20.650
So we select the first name, last name of the employees.

00:21:21.470 --> 00:21:25.030
So si employer cursor, siya yung nag-hold lahat ng first name and last name.

00:21:25.030 --> 00:21:29.230
So what we did is we looped it.

00:21:29.270 --> 00:21:33.890
So we fetched the employer cursor into first name and last name.

00:21:33.950 --> 00:21:35.950
So we get the first name and last name.

00:21:36.290 --> 00:21:41.990
So since wala tayong nilagay, for example, address or maybe avatar or picture,

00:21:42.750 --> 00:21:44.810
so hindi rin natin siya magagamit dito.

00:21:45.370 --> 00:21:48.230
So it's very useful kapag multiple yung queries mo.

00:21:49.150 --> 00:21:52.150
For example, you need a piece of this on the stable.

00:21:52.250 --> 00:21:54.570
You need another piece on the stable.

00:21:54.570 --> 00:21:58.650
Then you can leverage that using the explicit cursor.

00:21:59.510 --> 00:22:04.570
So yung explicit cursor, it's your user-predefined,

00:22:05.550 --> 00:22:09.370
depending nga dun sa query mo or sa data na gusto mong ilagay sa kanil.

00:22:10.370 --> 00:22:13.210
Iba may employee cursor ko tayo?

00:22:14.010 --> 00:22:18.510
So yung unang cursor ko natin, niliraturn niyo yung first name and last name.

00:22:18.550 --> 00:22:20.810
May niliraturn niyo yung first name and last name?

00:22:20.990 --> 00:22:23.050
Or may salari lamad niya?

00:22:23.050 --> 00:22:23.770
Yes, pwede.

00:22:24.450 --> 00:22:27.690
Basta related dun sa isang variable na yan?

00:22:40.370 --> 00:22:41.890
Pwede mo siyang magamit?

00:22:42.350 --> 00:22:43.810
Yes, yes, yes.

00:22:45.010 --> 00:22:50.590
So again, yung implicit cursor, yung deklarisyon niya sa implicit,

00:22:50.730 --> 00:22:53.030
it handled automatically by PLSQL.

00:22:53.930 --> 00:22:59.390
Yung explicit naman, it must be declared explicitly by the user or programmer.

00:23:00.350 --> 00:23:05.930
Pagdating naman sa row, yung implicit, it handles only one single query.

00:23:05.930 --> 00:23:11.730
While yung explicit cursor, it handled multiple rows or multi-row queries.

00:23:14.410 --> 00:23:20.090
Yung lifecycle naman niya, yung implicit, PLSQL managed it automatically,

00:23:21.070 --> 00:23:25.990
while sa explicit cursor, tayo, yung programmer, must manage it explicitly.

00:23:25.990 --> 00:23:29.790
In terms of credibility, as well as explicit?

00:23:30.150 --> 00:23:31.490
Yes, yes.

00:23:31.590 --> 00:23:36.090
Pero depending sa usage mo, kung single row lang naman yung kailangan mo,

00:23:36.610 --> 00:23:38.890
then just use the implicit cursor.

00:23:39.810 --> 00:23:49.010
Yung attribute dun sa implicit cursor, yung SQL percent found, SQL percent not found, SQL percent row count.

00:23:49.010 --> 00:23:56.710
While dun sa explicit, mayroon tayong percent found, percent not found, percent row count, percent is open.

00:23:57.150 --> 00:24:00.890
Tapos siyempre flexibility niya, mas flexible siyempre sa explicit.

00:24:01.690 --> 00:24:06.130
While si implicit, limited lang to simple operation lang.

00:24:08.330 --> 00:24:15.050
Kung simple lang, implicit, but if you want more complex, go to explicit cursor.

00:24:15.050 --> 00:24:15.730
Okay.

00:24:17.590 --> 00:24:19.770
So let's try declaring variable.

00:24:20.770 --> 00:24:27.950
It is the process of defining placeholder that didn't store data values temporarily during program execution.

00:24:29.650 --> 00:24:37.050
So we type variable name, yung piligayang natin gaapan data type, it is not...

00:24:37.050 --> 00:24:38.910
And if we...

00:24:38.910 --> 00:24:43.930
Yung not null, it's an optional to ensure that the variable cannot hold a null value.

00:24:45.910 --> 00:24:48.930
Then initial value, it's optional as well.

00:24:49.030 --> 00:24:54.170
It allows you to assign value when the variable is declared.

00:24:55.930 --> 00:25:00.410
So in our case, I think we tackled it yesterday.

00:25:05.130 --> 00:25:16.490
Then the percent type attribute, again, remember we have a percent row type na it holds the entire row of the table.

00:25:17.150 --> 00:25:24.370
But for example, if we want to hold lang yung salary ng employees, we use percent type.

00:25:24.370 --> 00:25:31.250
So employees yun yung table name, dot yung field which is yung salary, percent type.

00:25:31.370 --> 00:25:43.010
So if we want to hold the variable or the column of the, for example, phrase name, we say employees dot first rscore name, percent type.

00:25:43.010 --> 00:25:54.530
Okay, so yung not null, optional siya, tapos kung gusto mo siyang lagyan ng yan here, we begin putting a value on the employee salary.

00:25:58.130 --> 00:26:00.310
So let's try step by step.

00:26:00.670 --> 00:26:07.030
I think yun, natutunan natin how to open the cursor tapos i-fetch natin yung cursor name.

00:26:07.930 --> 00:26:15.430
Then we have an example on opening and fetching the first row.

00:26:16.090 --> 00:26:29.450
So again, we declare the employee cursor then tapos from this query tapos we can fetch it na and use it to display whatever we want or we can loop.

00:26:29.450 --> 00:26:35.670
So ang step natin is open the cursor name, fetch the data, then don't forget the close.

00:26:35.770 --> 00:26:41.850
Kasi pag hindi natin siya clean hose, it can lead to error or kumagang nakopen pa rin siya sa memory.

00:26:44.030 --> 00:26:46.590
So be sure to always close your cursor name.

00:26:47.310 --> 00:26:53.330
So pag mag-fetch naman tayo ng multiple rows, so we loop it.

00:26:54.070 --> 00:26:58.450
So we fetch the employee cursor into first name and last name.

00:26:58.450 --> 00:27:03.370
Exit natin kapag, laragin natin ng percent not pound.

00:27:03.690 --> 00:27:05.870
So employee cursor percent not pound.

00:27:07.110 --> 00:27:13.670
If you want to check yung percent row count, pwede rin kung baka ilan na siya.

00:27:13.830 --> 00:27:15.990
Kung ganyan rin gisa natin mag-stop sa 10 lang.

00:27:20.170 --> 00:27:22.550
I think it's better to try this.

00:27:22.710 --> 00:27:24.270
Let's try this.

00:27:24.270 --> 00:27:27.170
Slide 190.

00:27:30.150 --> 00:27:34.210
Let's try opening and fetching the first row, 190.

00:27:42.150 --> 00:27:44.350
I'm gonna highlight it.

00:28:11.850 --> 00:28:17.470
How about try to use percent row count to exit it?

00:28:17.470 --> 00:28:24.590
For example, I will require you to display only the 5 employees.

00:28:24.770 --> 00:28:27.030
How do you gonna use the percent row count?

00:28:27.170 --> 00:28:31.170
I want to stop or I want to show only the 5 employees.

00:28:32.010 --> 00:28:35.370
Can you try to apply percent row count?

00:28:36.610 --> 00:28:38.030
Where you gonna put the row count?

00:28:39.230 --> 00:28:40.410
Yeah, there you go.

00:28:41.610 --> 00:28:42.870
In the exit when?

00:28:47.610 --> 00:28:51.470
Dapat 5 lang yung makita natin pag niren yung screen.

00:28:55.690 --> 00:29:01.450
Again, you can click control enter to run it.

00:29:01.510 --> 00:29:03.470
Maybe because Miguel wala kang data doon.

00:29:04.210 --> 00:29:07.170
If you look at the table, if you click your table,

00:29:07.710 --> 00:29:10.230
maybe wala naman talagang first name yung employee

00:29:10.230 --> 00:29:13.090
and last name yung sa table mo.

00:29:13.250 --> 00:29:13.730
Can you check?

00:29:13.730 --> 00:29:16.210
Click data.

00:29:16.250 --> 00:29:18.470
Data tab yan.

00:29:19.210 --> 00:29:21.230
Walang first name yung nilagay natin.

00:29:21.890 --> 00:29:23.730
Yung first underscore name.

00:29:24.190 --> 00:29:25.090
Kaya wala siyang nandetect.

00:29:25.270 --> 00:29:28.990
You can put anything now then commit the changes.

00:29:29.810 --> 00:29:31.750
Yung tinitin na mukhang is emp name.

00:29:32.310 --> 00:29:34.230
Dun sa first underscore name.

00:29:34.550 --> 00:29:36.530
Yung pang ano na column.

00:29:37.930 --> 00:29:40.710
Let's put any name then commit.

00:29:40.710 --> 00:29:43.710
Okay, try the code again.

00:29:51.050 --> 00:29:51.550
There you go.

00:29:55.230 --> 00:29:57.590
Okay, you're learning so far guys.

00:30:02.430 --> 00:30:05.750
Okay, so let's dig more.

00:30:07.410 --> 00:30:11.850
Again, we use cursor not found to exit the loop

00:30:12.770 --> 00:30:15.290
or if any condition you want.

00:30:16.570 --> 00:30:21.090
So here we exit the employee cursor

00:30:21.090 --> 00:30:22.870
with not found which we already tried.

00:30:23.830 --> 00:30:26.470
Then don't forget to close the cursor name.

00:30:27.030 --> 00:30:29.930
So close statement is used to release again

00:30:29.930 --> 00:30:33.790
the resources associated with the cursor.

00:30:33.790 --> 00:30:36.790
So once it has completed fetching the data.

00:30:37.950 --> 00:30:40.010
Closing cursor is important

00:30:40.010 --> 00:30:42.770
because it helps to pre-up server memory

00:30:42.770 --> 00:30:45.370
and avoid potential resource leak

00:30:45.370 --> 00:30:47.790
especially when working with multiple cursor

00:30:47.790 --> 00:30:51.510
or in application that frequently open and close cursor.

00:30:53.970 --> 00:30:55.250
So when to close a cursor?

00:30:55.530 --> 00:30:57.270
After fetching all rows

00:30:57.270 --> 00:30:59.790
and inside exception handlers.

00:31:01.550 --> 00:31:06.690
Okay, so let's try the complete cursor lifecycle with close.

00:31:07.450 --> 00:31:09.190
Let's try the...

00:31:09.190 --> 00:31:12.810
I think you have this already first name.

00:31:13.010 --> 00:31:14.750
Yeah, it's the same code we have.

00:31:15.450 --> 00:31:18.170
But yeah, it closed the employee cursor.

00:31:18.930 --> 00:31:20.410
But it's in the document.

00:31:20.450 --> 00:31:22.150
It's on slide 194.

00:31:22.930 --> 00:31:25.090
So again, our key points here is

00:31:25.090 --> 00:31:27.330
mandatory closing, always close a cursor.

00:31:27.330 --> 00:31:30.150
Then automatic close on program exit.

00:31:31.070 --> 00:31:33.310
So PLSQL automatically close cursor

00:31:33.310 --> 00:31:34.230
at the end of the block.

00:31:34.550 --> 00:31:36.550
However, it's best practice to close them

00:31:36.550 --> 00:31:39.070
manually for clarity and resource management.

00:31:39.990 --> 00:31:41.730
Also close in error handling.

00:31:41.930 --> 00:31:44.690
If an error occur, close any open cursor

00:31:45.410 --> 00:31:47.250
within the exception handling block

00:31:47.250 --> 00:31:48.690
to prevent resource leak.

00:31:49.130 --> 00:31:52.790
Remember we studied the error

00:31:52.790 --> 00:31:54.230
trapping errors yesterday.

00:31:54.230 --> 00:31:58.510
So you have to make sure that the cursor is open.

00:31:59.530 --> 00:32:00.150
Sorry, close.

00:32:01.250 --> 00:32:04.290
So using close is essential in PLSQL programming.

00:32:04.690 --> 00:32:07.230
So ensuring efficient use of database resource

00:32:07.890 --> 00:32:10.410
and keeping the code base clean and manageable.

00:32:14.750 --> 00:32:17.210
So we studied the for loop.

00:32:17.270 --> 00:32:19.170
We tried it as well.

00:32:21.810 --> 00:32:25.530
This one is for, one moment.

00:32:26.130 --> 00:32:28.530
So using reverse index example,

00:32:29.490 --> 00:32:32.830
for loop iterase over each row

00:32:32.830 --> 00:32:35.490
in the result set of a cursor.

00:32:36.090 --> 00:32:38.170
So pano naman nating gagamitin yung for

00:32:39.090 --> 00:32:41.650
dun sa cursor na ginawa natin.

00:32:42.750 --> 00:32:45.710
So for record variable in cursor name,

00:32:45.730 --> 00:32:47.450
tapos loop, then end loop.

00:32:47.450 --> 00:32:51.010
So a record variable,

00:32:51.250 --> 00:32:53.910
it's a record variable that holds the

00:32:53.910 --> 00:32:56.290
current from the cursor, then the cursor name.

00:32:57.130 --> 00:32:59.890
The name of the cursor being iterated.

00:33:00.650 --> 00:33:03.150
So alternatively, you can directly use SQL query

00:33:03.150 --> 00:33:06.290
within the for loop instead of the name cursor.

00:33:07.690 --> 00:33:11.910
So example of that is we declared a cursor,

00:33:12.470 --> 00:33:15.430
employee cursor, to select the first and last name

00:33:15.430 --> 00:33:16.410
from the employees.

00:33:17.030 --> 00:33:19.030
Then the cursor for loop,

00:33:20.070 --> 00:33:22.910
the loop iterate over each employee cursor,

00:33:23.350 --> 00:33:24.690
then automatic handling,

00:33:25.110 --> 00:33:26.750
so automatically opens the cursor,

00:33:27.910 --> 00:33:30.390
fetches each row into employee record,

00:33:30.670 --> 00:33:33.350
and closes the cursor after the loop completes.

00:33:34.530 --> 00:33:37.330
Then it can output the loop print

00:33:37.330 --> 00:33:39.410
each employee's first name and last name.

00:33:40.570 --> 00:33:42.990
You can also use direct query instead of cursor.

00:33:42.990 --> 00:33:45.390
So this is equivalent to using cursor

00:33:45.390 --> 00:33:47.550
but without needing to declare it separately.

00:33:48.650 --> 00:33:51.690
So again, our key point here is the numeric for loop,

00:33:52.010 --> 00:33:54.810
best for iterating over a specific range of integer.

00:33:56.030 --> 00:33:57.310
So numeric for loop,

00:33:57.390 --> 00:33:59.190
then we have a cursor for loop,

00:33:59.650 --> 00:34:02.530
it automatically handles cursor operation

00:34:02.530 --> 00:34:05.390
making it ideal for row by row processing

00:34:05.390 --> 00:34:07.070
of query result.

00:34:07.270 --> 00:34:11.390
Then the reverse keyword allows numeric loops

00:34:11.390 --> 00:34:13.770
to run in descending order.

00:34:15.690 --> 00:34:19.230
Now let's try to use the update.

00:34:20.290 --> 00:34:23.310
Can you try the slide 198 please?

00:34:23.530 --> 00:34:26.890
So this time we're gonna declare the cursor.

00:34:29.110 --> 00:34:30.470
So while you're trying,

00:34:30.730 --> 00:34:31.650
I'm gonna explain.

00:34:32.530 --> 00:34:33.490
We declare a cursor,

00:34:33.690 --> 00:34:36.390
so we have employee cursor defined by

00:34:36.910 --> 00:34:39.410
select employee ID and salary

00:34:39.410 --> 00:34:41.410
from the employees table.

00:34:41.570 --> 00:34:47.710
So kung wala kayong ID na 20

00:34:47.710 --> 00:34:49.310
dun sa department ID,

00:34:50.410 --> 00:34:52.730
check the table and you can add ID

00:34:52.730 --> 00:34:57.030
or edit one of your table.

00:34:57.250 --> 00:34:59.250
I believe you have all departments ID.

00:34:59.930 --> 00:35:01.870
So check the data if kung may 20 kayo

00:35:03.090 --> 00:35:05.210
or para makapaguran yung code.

00:35:07.150 --> 00:35:08.110
Don't worry,

00:35:09.130 --> 00:35:11.390
all this code will be sent to you as well

00:35:11.390 --> 00:35:13.130
for your future reference.

00:35:14.730 --> 00:35:15.850
So no need to save,

00:35:15.910 --> 00:35:18.210
but you can save as well if you want.

00:35:19.390 --> 00:35:20.090
Check that.

00:35:20.330 --> 00:35:23.070
So right now we don't have 20 in the departments.

00:35:24.010 --> 00:35:25.630
So you can add another table

00:35:25.630 --> 00:35:28.310
or edit other one.

00:35:29.850 --> 00:35:31.290
So in the department,

00:35:31.810 --> 00:35:34.250
Sir Miguel, you can click the data

00:35:34.250 --> 00:35:36.250
para makita mo po yung laman

00:35:37.090 --> 00:35:39.250
on the departments tab.

00:35:46.650 --> 00:35:49.530
At 10 a.m. we're gonna have a short break.

00:35:49.750 --> 00:35:51.850
Sir Miguel, may department ID ka na na 20

00:35:52.410 --> 00:35:53.650
sa table mo?

00:35:55.830 --> 00:35:56.410
Yes, Sir.

00:35:57.870 --> 00:35:58.330
Okay.

00:35:59.590 --> 00:36:01.150
Hindi, dun sa departments mo

00:36:01.150 --> 00:36:03.870
may table ka na ba, may ID ka na ba na 20?

00:36:03.870 --> 00:36:04.950
Wala pa ko, Sir.

00:36:06.590 --> 00:36:08.030
Click mo yung data.

00:36:08.870 --> 00:36:10.910
Sir Miguel, click mo yung data

00:36:10.910 --> 00:36:11.870
next to column yan.

00:36:13.190 --> 00:36:14.470
Okay, mayroon ka na pala 20,

00:36:15.050 --> 00:36:16.210
yung HR.

00:36:18.110 --> 00:36:20.190
You can try to run the code.

00:36:23.450 --> 00:36:24.970
Magkakiawalay ba kayo ng table

00:36:24.970 --> 00:36:26.110
or magkatabi kayo

00:36:26.110 --> 00:36:28.490
or nasa isang conference kayo?

00:36:31.070 --> 00:36:32.510
Or nakalaptop kayo lahat?

00:36:32.510 --> 00:36:34.290
Okay, then you're sitting

00:36:34.290 --> 00:36:36.050
in one room.

00:36:36.850 --> 00:36:38.510
Okay, I'm just trying to

00:36:39.510 --> 00:36:40.190
imagine

00:36:40.190 --> 00:36:42.510
your current setup right now.

00:36:45.150 --> 00:36:46.510
So nakapag-run na ba ang lahat?

00:36:59.710 --> 00:37:00.970
Okay, so that is

00:37:00.970 --> 00:37:02.270
the update statement.

00:37:02.270 --> 00:37:04.670
You can play it more in a bit.

00:37:04.990 --> 00:37:06.110
Do you have any more questions

00:37:06.110 --> 00:37:07.710
so far or we can continue?

00:37:08.130 --> 00:37:09.930
Okay, I think it's a no.

00:37:11.330 --> 00:37:11.490
Okay.

00:37:11.670 --> 00:37:12.450
Sorry, Sir.

00:37:13.410 --> 00:37:13.790
Go ahead.

00:37:15.070 --> 00:37:16.070
Yung sa, ah,

00:37:16.150 --> 00:37:16.490
finish ko na na,

00:37:16.490 --> 00:37:19.430
sa Google Sheet ko.

00:37:19.430 --> 00:37:21.330
Okay. Ah, you can, one moment.

00:37:21.590 --> 00:37:23.490
Let me check in my Google Sheet.

00:37:24.390 --> 00:37:25.270
Nakapag-piss ka.

00:37:25.530 --> 00:37:26.410
Anong line?

00:37:28.630 --> 00:37:28.890
Do,

00:37:29.870 --> 00:37:30.390
Yes.

00:37:33.830 --> 00:37:35.950
Ay, ay, dun sa audience. Okay.

00:37:40.130 --> 00:37:41.010
Yun yung tanong.

00:37:41.030 --> 00:37:42.110
What will happen

00:37:43.990 --> 00:37:45.630
if the cursor

00:37:48.490 --> 00:37:50.650
is not properly closed

00:37:50.650 --> 00:37:52.470
during procedural call?

00:37:53.250 --> 00:37:55.350
Any side effects of

00:37:55.350 --> 00:37:56.790
negative effect?

00:37:59.270 --> 00:38:00.650
First is memory leak.

00:38:00.990 --> 00:38:02.030
So an open cursor

00:38:02.030 --> 00:38:03.330
consume memory

00:38:03.330 --> 00:38:05.470
and other system resources.

00:38:05.550 --> 00:38:06.870
So if it is not closed,

00:38:07.630 --> 00:38:09.670
these resources remain occupied.

00:38:09.870 --> 00:38:11.710
Okay, leading to memory leaks.

00:38:12.850 --> 00:38:13.750
So, also

00:38:13.750 --> 00:38:15.370
exceeding open cursor limit

00:38:15.370 --> 00:38:17.030
kasi, um,

00:38:17.210 --> 00:38:18.550
pwede kayong maka-receive nun.

00:38:19.110 --> 00:38:20.850
For example, um,

00:38:21.010 --> 00:38:22.530
most database have a limit

00:38:22.530 --> 00:38:24.790
on the number of open cursor as a session.

00:38:25.350 --> 00:38:26.590
A session can hold.

00:38:27.430 --> 00:38:29.030
So, um,

00:38:29.490 --> 00:38:31.010
we can see that in the open

00:38:31.010 --> 00:38:32.370
cursor parameter in Oracle.

00:38:32.690 --> 00:38:34.590
So if cursor are not closed,

00:38:35.190 --> 00:38:36.990
the limit might be exceeded

00:38:36.990 --> 00:38:38.270
causing the session

00:38:38.270 --> 00:38:40.890
to throw an error like

00:38:40.890 --> 00:38:42.490
over, I think, the

00:38:42.490 --> 00:38:43.750
zero one thousand.

00:38:43.790 --> 00:38:46.330
It says maximum open

00:38:46.330 --> 00:38:47.290
cursor exceeded.

00:38:48.330 --> 00:38:49.770
Also, the performance

00:38:50.690 --> 00:38:52.350
degradation, I think,

00:38:52.750 --> 00:38:54.450
because keeping unused cursor open

00:38:54.450 --> 00:38:56.610
can degrade performance

00:38:56.610 --> 00:38:58.910
as resources are necessarily

00:38:58.910 --> 00:39:00.390
unnecessarily consumed.

00:39:01.210 --> 00:39:02.130
Kasi nga, may memory siya.

00:39:02.490 --> 00:39:04.750
So, magi-slow yung program along the way.

00:39:05.750 --> 00:39:06.530
So, it will

00:39:06.530 --> 00:39:08.110
slow down the database and, you know,

00:39:08.210 --> 00:39:10.090
it reduce efficiency for other

00:39:10.090 --> 00:39:11.750
operations or sessions.

00:39:12.110 --> 00:39:14.270
Um, also the lock retention,

00:39:14.890 --> 00:39:16.090
some cursor

00:39:16.850 --> 00:39:18.130
might hold

00:39:18.130 --> 00:39:19.430
locks on resources.

00:39:20.170 --> 00:39:22.110
So, for example, um, yung cursor

00:39:22.110 --> 00:39:23.830
na yun, nilock niya yung table.

00:39:24.470 --> 00:39:25.970
So, pag hindi mo cleanose,

00:39:26.290 --> 00:39:27.550
nakalock pa rin table na yun.

00:39:28.150 --> 00:39:29.870
So, failing to close the cursor

00:39:29.870 --> 00:39:31.690
could result in lock contention.

00:39:32.670 --> 00:39:34.390
So, preventing other session

00:39:34.390 --> 00:39:35.950
from accessing those resources

00:39:35.950 --> 00:39:38.190
and potentially leading to

00:39:38.190 --> 00:39:39.370
deadlocks.

00:39:39.470 --> 00:39:42.270
So, that's the worst scenario we can

00:39:42.270 --> 00:39:44.590
experience kung hindi natin i-close.

00:39:44.850 --> 00:39:46.370
So, hanapin pa natin kung

00:39:46.370 --> 00:39:48.190
anong cursor yung naka-open

00:39:49.110 --> 00:39:50.270
para lang ma-unlock

00:39:50.270 --> 00:39:51.110
yung table.

00:39:51.790 --> 00:39:53.490
Also, connection stability issues.

00:39:53.630 --> 00:39:55.950
So, over time, unclosed cursor

00:39:55.950 --> 00:39:57.590
can accumulate

00:39:58.190 --> 00:39:59.350
destabilizing the database,

00:40:00.190 --> 00:40:02.190
connection, causing errors, or even

00:40:02.790 --> 00:40:04.450
crashing the session or application.

00:40:05.510 --> 00:40:05.950
And

00:40:05.950 --> 00:40:07.870
lastly, I think, is the logical error

00:40:07.870 --> 00:40:09.990
in application. So, you know, not closing

00:40:09.990 --> 00:40:10.710
a cursor

00:40:11.950 --> 00:40:14.170
might lead to unexpected behavior

00:40:14.170 --> 00:40:16.110
in application that depend

00:40:16.110 --> 00:40:18.170
on proper cursor management.

00:40:18.690 --> 00:40:19.950
For instance, data

00:40:19.950 --> 00:40:21.830
might remain stale or

00:40:21.830 --> 00:40:24.250
unprocessed, or operation

00:40:24.250 --> 00:40:25.950
might fail to execute

00:40:26.910 --> 00:40:28.230
as intended.

00:40:29.750 --> 00:40:30.990
So, yeah.

00:40:31.570 --> 00:40:34.170
So, best practice natin, always

00:40:34.170 --> 00:40:35.350
close the cursor.

00:40:36.730 --> 00:40:37.530
Especially,

00:40:38.470 --> 00:40:39.670
yung mga

00:40:39.670 --> 00:40:41.750
explicitly closed, yung mga

00:40:41.750 --> 00:40:43.030
explicitly closed cursor.

00:40:43.910 --> 00:40:45.730
Tapos, use implicit cursor

00:40:45.730 --> 00:40:47.770
when possible. So, implicit

00:40:47.770 --> 00:40:49.710
cursor automatically managed

00:40:49.710 --> 00:40:51.990
by the Oracle or by the database,

00:40:52.270 --> 00:40:53.910
reducing the need for manual

00:40:53.910 --> 00:40:55.970
handling. So, later I'll

00:40:55.970 --> 00:40:57.850
give more sample of

00:40:57.850 --> 00:40:59.370
implicit cursor since

00:40:59.370 --> 00:41:01.790
this is the second

00:41:01.790 --> 00:41:02.070
question.

00:41:04.190 --> 00:41:05.550
Then, utilize the

00:41:05.550 --> 00:41:07.770
for loops. So, when working

00:41:07.770 --> 00:41:08.730
PLSQL,

00:41:10.150 --> 00:41:11.770
use the cursor for loops as they

00:41:11.770 --> 00:41:13.670
automatically open, fetch, and

00:41:13.670 --> 00:41:14.370
close the cursor.

00:41:15.650 --> 00:41:17.310
Then, monitor the open cursor.

00:41:17.730 --> 00:41:19.610
So, regularly check the number of open

00:41:19.610 --> 00:41:21.710
cursor in the database using

00:41:21.710 --> 00:41:23.290
monitoring tools or queries.

00:41:24.030 --> 00:41:25.790
In Oracle, we can say querying

00:41:26.890 --> 00:41:27.790
v open

00:41:27.790 --> 00:41:29.570
cursor. Mamiya, I'll provide the code

00:41:29.570 --> 00:41:32.030
how to see the open cursor.

00:41:36.330 --> 00:41:37.290
Yeah. So, next.

00:41:37.490 --> 00:41:39.570
Did I answer your question po? Sir Miguel?

00:41:40.730 --> 00:41:41.550
Yes, po sir.

00:41:41.890 --> 00:41:43.690
Thank you. Thank you so much.

00:41:44.770 --> 00:41:45.650
Then, another one

00:41:45.650 --> 00:41:47.650
is, can we have another example for

00:41:47.650 --> 00:41:49.430
implicit cursor? Sure.

00:41:50.630 --> 00:41:51.730
Let me create

00:41:51.730 --> 00:41:53.110
using explicit

00:41:53.110 --> 00:41:55.870
cursor. Let me

00:41:55.870 --> 00:41:57.890
paste in the

00:41:57.890 --> 00:41:59.030
one moment.

00:42:00.450 --> 00:42:02.050
In the Google Docs.

00:42:02.710 --> 00:42:03.950
In slide 198 parin

00:42:03.950 --> 00:42:04.950
pero explicit.

00:42:06.490 --> 00:42:07.970
Slide 198

00:42:07.970 --> 00:42:09.670
implicit cursor.

00:42:11.010 --> 00:42:12.030
So, we declare

00:42:12.030 --> 00:42:13.490
first name.

00:42:13.750 --> 00:42:15.510
Okay, can you try the

00:42:16.430 --> 00:42:18.010
EMP ID tayo?

00:42:18.670 --> 00:42:19.910
Can you try slide

00:42:19.910 --> 00:42:21.690
198 implicit cursor?

00:42:21.930 --> 00:42:22.630
I make it bold?

00:42:23.870 --> 00:42:25.910
So, this is the example of implicit

00:42:25.910 --> 00:42:25.990
cursor.

00:42:29.190 --> 00:42:30.150
So, the

00:42:30.150 --> 00:42:31.850
implicit cursor execution is the

00:42:31.850 --> 00:42:33.910
select then into

00:42:33.910 --> 00:42:35.790
statement. Automatically

00:42:35.790 --> 00:42:36.830
open the cursor.

00:42:37.590 --> 00:42:39.530
So, when we have a select,

00:42:40.370 --> 00:42:41.710
it's the implicit cursor.

00:42:42.310 --> 00:42:43.230
Select into.

00:42:43.850 --> 00:42:45.670
It fetches the data into the

00:42:45.670 --> 00:42:47.770
specified variables. Be employee

00:42:47.770 --> 00:42:50.110
name and be employee salary

00:42:50.110 --> 00:42:51.290
and closes the cursor.

00:42:52.130 --> 00:42:53.890
So, no explicit cursor

00:42:53.890 --> 00:42:55.950
management is required. You don't

00:42:55.950 --> 00:42:57.790
need to manually open,

00:42:58.390 --> 00:42:59.650
fetch, and close the cursor.

00:43:00.190 --> 00:43:02.210
The database handle it for you.

00:43:02.850 --> 00:43:03.730
Then, also exception

00:43:03.730 --> 00:43:05.690
handling errors like no data found,

00:43:05.870 --> 00:43:07.810
too many rows. If more than

00:43:07.810 --> 00:43:09.590
one row matches condition,

00:43:09.850 --> 00:43:11.850
should be handled explicitly in

00:43:11.850 --> 00:43:12.670
the exception block.

00:43:13.570 --> 00:43:15.490
I'll give you another

00:43:15.490 --> 00:43:17.750
example using DML.

00:43:19.230 --> 00:43:19.790
Statement.

00:43:20.970 --> 00:43:21.830
Again, slide

00:43:21.830 --> 00:43:23.310
198 pa rin.

00:43:23.390 --> 00:43:25.830
Another example.

00:43:31.670 --> 00:43:32.670
Hello sir. Yes po.

00:43:33.470 --> 00:43:34.930
Ayun na, gets na po namin.

00:43:35.230 --> 00:43:37.110
Bale pala, si

00:43:37.110 --> 00:43:39.050
implicit, pag single row.

00:43:39.290 --> 00:43:40.910
So, select into po yung ginagam.

00:43:41.030 --> 00:43:42.310
Yes, yes.

00:43:44.230 --> 00:43:45.550
Na hard na cursor din.

00:43:47.030 --> 00:43:47.670
So, si cursor

00:43:47.670 --> 00:43:49.150
pang collection talaga din.

00:43:49.150 --> 00:43:51.070
Yes, yes. Correct.

00:43:52.170 --> 00:43:52.630
Okay na po.

00:43:53.170 --> 00:43:55.010
Tapos, hindi mo na kalang i-close,

00:43:55.230 --> 00:43:56.970
hindi mo na kalang i-fetch din.

00:43:57.070 --> 00:43:58.370
Kasi, yun na yun.

00:44:00.470 --> 00:44:00.870
Yes.

00:44:04.350 --> 00:44:04.550
Okay.

00:44:05.650 --> 00:44:06.410
You're welcome.

00:44:09.730 --> 00:44:11.210
So, yung update statement na

00:44:11.210 --> 00:44:12.190
tray na po ba natin?

00:44:14.150 --> 00:44:15.150
Nakakapag update na tayo?

00:44:16.210 --> 00:44:16.510
Okay.

00:44:16.510 --> 00:44:17.790
Nung sa department ko, no?

00:44:18.030 --> 00:44:19.490
Yes, yes, yes.

00:44:19.950 --> 00:44:20.970
Okay, let's move on.

00:44:21.930 --> 00:44:23.570
So, eto naman yung example natin

00:44:23.570 --> 00:44:25.350
for conditional update.

00:44:26.310 --> 00:44:27.110
So, we just

00:44:28.510 --> 00:44:30.110
we declare the cursor

00:44:30.110 --> 00:44:31.770
with conditional check inside

00:44:31.770 --> 00:44:33.750
the loop, check if the salary

00:44:34.510 --> 00:44:35.530
is less than

00:44:35.530 --> 00:44:38.010
4,000, then we update

00:44:38.750 --> 00:44:40.350
using the update statement

00:44:40.350 --> 00:44:41.910
if the condition is true,

00:44:42.410 --> 00:44:44.330
we set the salary to

00:44:44.330 --> 00:44:46.210
4,000 for that employee.

00:44:47.490 --> 00:44:47.990
Then, output,

00:44:48.350 --> 00:44:49.990
so the updated salary for each

00:44:49.990 --> 00:44:51.550
qualifying employees is printed.

00:44:52.510 --> 00:44:54.290
So, we have direct update

00:44:54.290 --> 00:44:55.850
used for simple updates

00:44:55.850 --> 00:44:58.350
with a pre-wear clause to specify

00:44:58.350 --> 00:45:00.030
which row to modify.

00:45:00.330 --> 00:45:02.010
Then, we have the cursor update

00:45:02.010 --> 00:45:04.690
with update. This approach allows

00:45:04.690 --> 00:45:06.210
row by row control and each

00:45:06.210 --> 00:45:08.330
following when different values

00:45:08.330 --> 00:45:10.230
or condition are required for each row.

00:45:10.970 --> 00:45:12.290
Then, conditional updates

00:45:12.290 --> 00:45:14.910
using conditions inside the loops

00:45:14.910 --> 00:45:16.650
provide flexibility

00:45:16.650 --> 00:45:18.410
for applying specific

00:45:18.410 --> 00:45:20.050
updates based on criteria.

00:45:21.350 --> 00:45:22.610
So, yeah.

00:45:23.470 --> 00:45:24.330
So, eto yung example

00:45:24.330 --> 00:45:26.290
ng update. We will have a coding

00:45:26.290 --> 00:45:28.290
in slide 205.

00:45:29.850 --> 00:45:30.350
One moment.

00:45:30.790 --> 00:45:32.490
So, yeah. So, for update

00:45:32.490 --> 00:45:34.450
clause, it locks

00:45:34.450 --> 00:45:35.690
all row

00:45:36.290 --> 00:45:38.430
that cursor select. So, eto

00:45:38.430 --> 00:45:40.410
for update, if you're

00:45:40.410 --> 00:45:41.830
looking at my mouse cursor,

00:45:41.990 --> 00:45:44.610
so it locks the database

00:45:44.610 --> 00:45:46.870
para hindi

00:45:46.870 --> 00:45:47.930
hindi mo na siyang bago.

00:45:48.110 --> 00:45:50.210
So, this is useful in multi-user environment

00:45:50.210 --> 00:45:52.210
where multiple session may

00:45:52.210 --> 00:45:54.470
attempt to modify the same data.

00:45:56.290 --> 00:45:56.510
The

00:45:56.510 --> 00:45:57.770
effect for update

00:45:58.410 --> 00:46:00.350
it allows return by the select

00:46:00.350 --> 00:46:02.910
query. So, other sessions

00:46:02.910 --> 00:46:04.070
will be unable

00:46:04.070 --> 00:46:06.010
to update or delete this row

00:46:06.010 --> 00:46:08.350
until the transaction is

00:46:08.350 --> 00:46:10.350
submitted or rolled back.

00:46:10.930 --> 00:46:12.470
So, in this case,

00:46:12.510 --> 00:46:13.730
we declare the cursor

00:46:14.930 --> 00:46:15.570
oops.

00:46:18.150 --> 00:46:18.370
So, in

00:46:18.370 --> 00:46:20.390
this case, we declare the cursor

00:46:22.010 --> 00:46:23.890
we loop and update

00:46:23.890 --> 00:46:26.390
the for loop iterates

00:46:26.390 --> 00:46:27.710
over each locked row.

00:46:28.150 --> 00:46:30.170
Then, update the statement, modifies

00:46:30.170 --> 00:46:32.630
the salary for each employee.

00:46:33.310 --> 00:46:34.410
Then, we're current

00:46:34.410 --> 00:46:38.290
off. So,

00:46:38.290 --> 00:46:39.550
after the update, the current row

00:46:39.550 --> 00:46:41.910
in the cursor will simplify updates.

00:46:42.050 --> 00:46:43.410
Then, don't forget the commit.

00:46:43.650 --> 00:46:45.890
So, after the updates, commit is called

00:46:45.890 --> 00:46:46.910
to release the lock.

00:46:51.490 --> 00:46:53.450
So, for update of

00:46:53.450 --> 00:46:55.150
clause is similar

00:46:55.150 --> 00:46:56.790
to for update.

00:46:58.410 --> 00:46:59.970
So, but it's more specific.

00:47:00.250 --> 00:47:01.790
It locks only the column

00:47:01.790 --> 00:47:03.330
listed in the clause.

00:47:04.150 --> 00:47:06.050
This is useful if you need to lock

00:47:06.050 --> 00:47:07.990
only certain columns for update

00:47:07.990 --> 00:47:10.050
rather than the entire row.

00:47:10.970 --> 00:47:12.030
So, the effect

00:47:12.030 --> 00:47:14.050
of that is the for update of

00:47:14.050 --> 00:47:16.150
clause locks only the

00:47:16.150 --> 00:47:17.190
specified columns.

00:47:18.150 --> 00:47:19.950
Other user will be able to view

00:47:19.950 --> 00:47:22.030
the row but cannot modify the specified

00:47:22.030 --> 00:47:23.470
columns until the transaction

00:47:24.050 --> 00:47:25.410
again committed or rolled back.

00:47:26.310 --> 00:47:27.950
So, again, we declare the cursor

00:47:27.950 --> 00:47:29.390
in this example.

00:47:31.250 --> 00:47:32.230
The employee cursor.

00:47:32.410 --> 00:47:34.410
Then, we

00:47:34.410 --> 00:47:36.690
have the select statement here.

00:47:36.730 --> 00:47:38.230
Then, we

00:47:38.230 --> 00:47:40.170
for loop the cursor.

00:47:42.710 --> 00:47:44.230
Then, update

00:47:44.230 --> 00:47:46.510
the employee. So, if there's any

00:47:46.510 --> 00:47:46.890
error,

00:47:48.030 --> 00:47:49.990
it will commit

00:47:49.990 --> 00:47:51.850
all the transaction here.

00:47:52.190 --> 00:47:53.690
Then, it will release the lock.

00:47:54.870 --> 00:47:56.330
So, if there's

00:47:56.330 --> 00:47:58.470
any error here, you can

00:47:58.470 --> 00:48:00.410
return an error and

00:48:00.930 --> 00:48:02.650
roll back the changes.

00:48:04.410 --> 00:48:05.310
So, for update,

00:48:06.690 --> 00:48:08.270
it locks the entire row, meaning

00:48:08.270 --> 00:48:10.370
no part of the row

00:48:10.370 --> 00:48:12.550
can be modified by the other

00:48:12.550 --> 00:48:14.250
session. While the for

00:48:14.250 --> 00:48:16.450
update of locks only the

00:48:16.450 --> 00:48:17.790
specified columns,

00:48:18.650 --> 00:48:20.190
allowing other columns in the row

00:48:20.190 --> 00:48:21.810
to be updated by other session.

00:48:22.950 --> 00:48:24.430
So, again, importance note.

00:48:24.910 --> 00:48:26.130
Locks held until

00:48:26.130 --> 00:48:28.110
commit or roll back.

00:48:28.670 --> 00:48:30.330
Locks set for update or for

00:48:30.330 --> 00:48:32.470
update of are held until you commit

00:48:32.470 --> 00:48:34.730
or roll back the transaction.

00:48:35.390 --> 00:48:36.530
Where current op, so

00:48:36.530 --> 00:48:38.650
when updating or deleting rows in a loop,

00:48:38.850 --> 00:48:40.570
where current op allows you to direct

00:48:40.570 --> 00:48:42.450
update the current row

00:48:42.450 --> 00:48:44.370
without a specifying condition.

00:48:45.810 --> 00:48:46.810
Then, concurrency

00:48:46.810 --> 00:48:48.470
control. Using the for update or for update

00:48:49.050 --> 00:48:50.290
op ensure

00:48:50.290 --> 00:48:52.770
consistency in multi-user environments

00:48:52.770 --> 00:48:54.530
by preventing other

00:48:54.530 --> 00:48:56.290
user from modifying data

00:48:56.290 --> 00:48:57.970
that you are working with.

00:48:59.890 --> 00:49:00.530
So,

00:49:01.830 --> 00:49:02.610
this is

00:49:02.610 --> 00:49:04.290
where current op clause

00:49:04.290 --> 00:49:06.450
is used in conjunction with the cursor

00:49:06.450 --> 00:49:08.570
to update or delete the

00:49:08.570 --> 00:49:10.670
current row that the cursor is pointing

00:49:10.670 --> 00:49:13.030
to. So, this clause especially

00:49:13.030 --> 00:49:14.670
useful when working

00:49:14.670 --> 00:49:16.650
within the loops that fetch row

00:49:16.650 --> 00:49:18.670
from a cursor. As it allows

00:49:18.670 --> 00:49:20.290
you to perform operation

00:49:20.290 --> 00:49:22.770
directly on the current row without the need

00:49:22.770 --> 00:49:24.630
to specify condition based

00:49:24.630 --> 00:49:25.730
on the column values.

00:49:26.890 --> 00:49:28.590
Okay, so it's

00:49:28.590 --> 00:49:29.430
10.08.

00:49:30.350 --> 00:49:32.310
Let's have a break on 10.10.

00:49:32.550 --> 00:49:33.870
Then, let's

00:49:34.590 --> 00:49:36.410
go back maybe

00:49:37.990 --> 00:49:39.030
10.40.

00:49:41.390 --> 00:49:42.430
10.40.

00:49:44.030 --> 00:49:44.370
But,

00:49:44.630 --> 00:49:46.250
yeah, then when you come back,

00:49:46.250 --> 00:49:47.450
when you have a chance,

00:49:48.150 --> 00:49:51.170
it is slide 2.0.5.

00:49:51.410 --> 00:49:51.510
Okay.

00:49:52.090 --> 00:49:53.950
So, let's have a break. Let's assume

00:49:53.950 --> 00:49:56.170
10.40. Be sure to

00:49:56.170 --> 00:49:58.450
run this code, okay?

00:50:00.710 --> 00:50:02.670
Slide 2.0.5. Thank you, guys.

00:50:03.050 --> 00:50:03.850
Have a quick break.

00:50:28.830 --> 00:50:29.350
A�

00:50:31.390 --> 00:50:32.610
Ano ba ginawa

00:50:32.610 --> 00:50:34.210
nya? Pinak-certify

00:50:34.210 --> 00:50:35.890
through copy na mali yun.

00:50:36.170 --> 00:50:37.730
Bakit naman ng ming machine pinabibigin ng

00:50:37.730 --> 00:50:38.970
certified through copy?

00:50:39.830 --> 00:50:42.650
Mabibintan na dito nung wala tayo alam.

00:50:42.910 --> 00:50:43.770
Tignan mo yung picture,

00:50:44.190 --> 00:50:46.050
certified through copy. Yung pinawan

00:50:46.050 --> 00:50:46.810
mo sa akin!

00:50:48.810 --> 00:50:50.690
Indi sabihin mo, sinabihan moZa sa

00:50:50.690 --> 00:50:51.710
Ati Lili.

00:50:52.390 --> 00:50:53.990
Hindi nakakamu nung iba-be. Tingnan mo?

00:50:54.650 --> 00:50:58.710
Nag-certify, tinanong ako diba doon, mami mag-certify through copy po.

00:50:58.750 --> 00:51:00.710
Ano ko hindi nasakan nalang mag-di-venta ko na?

00:51:01.050 --> 00:51:05.390
Sige, lago nga, ang munisip nyo naman nag-digay kita hindi may ari.

00:51:05.690 --> 00:51:07.610
Pin-certify through copy?

00:51:08.770 --> 00:51:13.550
Apeno hindi ikaw muna, lakihan mo, hindi po namin, hindi na po namin yan i-venta.

00:51:13.710 --> 00:51:15.850
Ialis na po sa forsake.

00:51:16.350 --> 00:51:17.870
Sige lang, ano nag-

00:51:17.870 --> 00:51:21.110
Pin-certify through copy na, kasi i-venta nila.

00:51:21.110 --> 00:51:21.670
Ano po namin?

00:51:22.950 --> 00:51:24.430
Ano po namin?

00:51:24.530 --> 00:51:25.770
Ano po namin?

00:52:05.810 --> 00:52:20.810
Ano po namin?

00:54:54.110 --> 00:54:57.110
Hi guys, we're back na po. Hello po.

00:54:59.830 --> 00:55:00.190
Okay, sir.

00:55:07.130 --> 00:55:09.010
Okay. Okay, copy, copy.

00:55:10.250 --> 00:55:15.310
Na-try nyo na po, yung, yung sign nyo yung code, yung slide 205.

00:55:16.750 --> 00:55:18.150
Okay.

00:55:50.390 --> 00:55:51.050
Hello.

00:55:51.390 --> 00:55:54.610
Yes, po. Sir, may question lang po.

00:55:54.830 --> 00:56:02.270
Dun sa update, yung current of, may ano po kung anong yung function niya?

00:56:04.370 --> 00:56:11.130
Karen o employee, of course sir. Meaning ito yung current sa loop? Yung po ba yun?

00:56:11.910 --> 00:56:15.690
Anong line yan? Yung for employee record?

00:56:17.430 --> 00:56:20.070
Apo, for employee record in employee car, sir po.

00:56:20.710 --> 00:56:21.390
Yung may update.

00:56:21.470 --> 00:56:23.230
Yes, yes.

00:56:23.570 --> 00:56:25.870
Ah, sabiig sabiig po nasa na yung loop, ah.

00:56:25.890 --> 00:56:26.690
Yes, yes.

00:56:26.770 --> 00:56:28.850
Pinukuhan yung card ng loop pa.

00:56:29.070 --> 00:56:29.690
Thank you, sir.

00:56:30.150 --> 00:56:30.730
Okay.

00:56:40.530 --> 00:56:46.250
May ginawa pa akong ano dyan, slide 205 with exception handling.

00:56:46.970 --> 00:56:48.730
You might want to try as well.

00:56:51.670 --> 00:56:55.290
Yung current off naman, it usually use update saka delete.

00:56:55.290 --> 00:56:58.430
So again, yun nga, you're right.

00:56:58.630 --> 00:57:02.170
Ano, yun yung current row dun sa for loop.

00:57:03.290 --> 00:57:05.110
Basta po inside yun yung for loop, po.

00:57:05.670 --> 00:57:05.970
Yes.

00:57:06.470 --> 00:57:14.490
Kasi kung, kung hindi tayo gagamit ng current off, ipipace ko yung sample dito.

00:57:15.490 --> 00:57:16.570
Ibo-bold ko siya.

00:57:17.670 --> 00:57:19.630
So ganyan nyo magiging tsura nya.

00:57:20.630 --> 00:57:21.850
Magbukha kita yung naman.

00:57:23.330 --> 00:57:27.850
So we're EMPID, employer record dot EMPID.

00:57:28.850 --> 00:57:34.090
At least yung, when current off, sure tayo na yun yung current na nasa loop.

00:57:34.810 --> 00:57:35.290
Yes.

00:57:35.410 --> 00:57:38.390
Dun sa for loop, yun yung current niya na record.

00:57:38.510 --> 00:57:39.570
Kasi yung for loop, diba?

00:57:39.810 --> 00:57:41.510
Row by row yan eh, each record.

00:57:43.050 --> 00:57:45.950
Pero what if, sir, pag walang karang ganun din po?

00:57:46.270 --> 00:57:46.850
Di lahat.

00:57:47.530 --> 00:57:54.870
Pag walang workload, siyempre lahat nung salary dun sa employees table.

00:57:56.250 --> 00:57:59.690
Diba, ang best practices kapag mag-update ka, siyempre dapat may wear.

00:57:59.990 --> 00:58:05.870
Kasi otherwise, baka accidentally, ma-update mo lahat nung salary nung employees.

00:58:07.190 --> 00:58:08.050
Or yung table.

00:58:08.310 --> 00:58:09.990
So nandiyan na pan lahat.

00:58:12.490 --> 00:58:13.210
Okay.

00:58:14.330 --> 00:58:14.810
Great.

00:58:15.290 --> 00:58:16.050
So yan.

00:58:16.250 --> 00:58:18.890
It's really good na natatry natin yung code.

00:58:19.030 --> 00:58:21.870
Also, I put exception handling.

00:58:25.130 --> 00:58:31.250
Kung gusto natin maglagay na exception handling, which is we must or we need to.

00:58:31.610 --> 00:58:34.110
Para at least kung may error, maro rollback natin.

00:58:34.290 --> 00:58:39.410
Maro rollback natin kasi diba yung for update,

00:58:39.410 --> 00:58:42.410
nilalock natin yung rows eh, diba?

00:58:43.610 --> 00:58:47.530
Dito yung sa for update, nilalock natin yung rows.

00:58:48.630 --> 00:58:52.210
So pag hindi natin na rollback, naka-lock pa rin yung rows.

00:58:52.530 --> 00:58:53.790
So hindi magagamit ng iba.

00:58:54.990 --> 00:58:56.490
Yung table na yan.

00:58:57.010 --> 00:58:59.370
Or yung data na ina-update.

00:59:01.150 --> 00:59:02.370
So let's move on.

00:59:02.590 --> 00:59:06.530
So let's try the work current of with delete.

00:59:06.630 --> 00:59:08.550
So ngayon naman mag-delete tayo.

00:59:08.550 --> 00:59:11.130
Gamit yung work current of.

00:59:11.630 --> 00:59:12.990
So let's try that.

00:59:14.150 --> 00:59:16.570
It's slide 206.

00:59:18.370 --> 00:59:23.830
So make it sure may data tayo na yung salary niya is less than 3,000.

00:59:23.990 --> 00:59:27.150
Tapos tingnan natin yung data na yan kung madi-delete.

00:59:28.030 --> 00:59:31.450
So make it sure, dun sa employees table nyo,

00:59:31.610 --> 00:59:35.870
meron kayong salary doon na papasak dun sa requirements na yan.

00:59:35.870 --> 00:59:39.790
So if not, maglagay tayo or mag-hardcode muna tayo for now.

00:59:39.990 --> 00:59:41.250
Dun sa employees table.

00:59:43.110 --> 00:59:46.610
To check the employees table, just click on your left, the employees.

00:59:46.810 --> 00:59:48.910
Then click the data column.

00:59:49.590 --> 00:59:52.330
Tapos may kita na natin yung data ng employees.

00:59:52.610 --> 00:59:55.450
So make it sure may pasok sa dun sa condition.

00:59:57.190 --> 01:00:00.110
Tapos pag niran nyo yung code, i-refresh nyo,

01:00:00.350 --> 01:00:01.530
balikan nyo yung employees table.

01:00:01.530 --> 01:00:07.530
Dapat mawala na yung employees na yan na may salary na less than 3,000.

01:00:13.550 --> 01:00:14.850
So before running the code,

01:00:15.050 --> 01:00:19.650
make it sure na-check nyo yung data ng table to do a comparison.

01:00:21.690 --> 01:00:23.930
Don't forget to commit.

01:00:24.370 --> 01:00:27.210
I see some people are editing some files.

01:00:27.370 --> 01:00:28.350
Don't forget to commit.

01:00:28.350 --> 01:00:31.950
Changes, yeah.

01:01:00.490 --> 01:01:04.350
Okay, sir. Miguel line on ID 100618.

01:01:05.730 --> 01:01:06.570
Yeah, try that.

01:01:11.070 --> 01:01:14.550
Oh, I think we have error in employee ID.

01:01:15.010 --> 01:01:18.110
It should be EMP ID.

01:01:50.070 --> 01:01:51.470
Okay.

01:02:23.070 --> 01:02:24.470
Okay.

01:02:52.750 --> 01:02:54.430
Everything good so far?

01:02:55.690 --> 01:02:57.630
Did you see that your data was deleted?

01:03:01.810 --> 01:03:03.270
Yes po, okay na po.

01:03:04.090 --> 01:03:04.590
Okay.

01:03:07.750 --> 01:03:09.150
Kanina ayaw mag-delete?

01:03:09.670 --> 01:03:10.250
All good naman?

01:03:28.330 --> 01:03:33.010
Okay, so let's continue.

01:03:33.990 --> 01:03:40.510
So yeah, the commit statement is a key tool in PLSQL for saving changes made during a transaction.

01:03:41.370 --> 01:03:51.550
So when working with a cursor, especially in a multi-user environment, strategic use of commit helps manage locks, maintain data consistency, and optimize performance.

01:03:52.210 --> 01:03:54.230
So let's explore how it works.

01:03:54.230 --> 01:04:03.390
So locks per update. It's when a cursor is read for the per update clause, rows patch the cursor or lock for duration of the transaction.

01:04:04.350 --> 01:04:12.130
So the impact of that is prevent other session from modifying those rows until the transaction is committed or rolled back.

01:04:12.830 --> 01:04:22.010
Row-by-row commits. So the commit changes after processing each row to reduce lock contention and ensure changes are saved incrementally.

01:04:22.010 --> 01:04:32.750
So one of the use cases ideal for large data set where committing after processing all rows could lead to lock contention or roll back overhead.

01:04:34.470 --> 01:04:42.590
Then number three is the release lock. So after a commit, all locks held by transaction are released, making rows available for other session.

01:04:42.590 --> 01:04:51.090
So the important of that is it reduce contention in multi-user environments and ensure data consistency.

01:04:52.250 --> 01:04:56.110
So we use the commit command to release lock after processing.

01:04:57.370 --> 01:05:06.430
So again, the benefit of the commit with cursor is reduce lock contention, incremental processing, and performance optimization.

01:05:07.270 --> 01:05:20.090
So using commit strategically with cursor ensure that changes are saved reliably, locks are managed efficiently, and performance is optimized, especially in multi-user environments.

01:05:21.910 --> 01:05:31.750
So yeah, let's try the commit more in this. It is in slide 208. Can you try it?

01:05:31.750 --> 01:05:41.250
Tapos, try din natin mag-run. Try to change the value. Tapos, without the commit. So dapat hindi siya mag-take effect.

01:05:43.110 --> 01:05:44.730
Yeah, slides 208.

01:06:25.010 --> 01:06:31.730
Be sure to check your tables to see if the changes made in the data.

01:06:31.730 --> 01:06:36.290
Be sure to refresh. Don't forget to refresh the tables.

01:06:44.750 --> 01:06:51.090
Okay, I will proceed now because we have more script that we will try.

01:06:51.730 --> 01:07:04.650
So this is the example of commit and we can see, for example if updated two rows, it will say updated salary of employee ID 101, 102, or whatever the employee ID.

01:07:06.450 --> 01:07:10.310
So ito naman yung example ng row by row commit within the loop.

01:07:11.730 --> 01:07:16.430
As you can see, yung commit nilagay natin dito sa laob ng for loop.

01:07:16.430 --> 01:07:22.430
So after ditong script, ikok commit nyo na agad.

01:07:23.790 --> 01:07:34.490
So depending sa business logic nyo, kung gusto nyo i-process muna yung buong for bago ikomit, or every row ikok commit.

01:07:34.990 --> 01:07:40.530
So if you want to row by row commit, ipot nyo lang yung commit nyo inside the for loop.

01:07:40.530 --> 01:07:46.810
Okay, then here's the conditional commit after set number of rows.

01:07:48.030 --> 01:07:54.590
So for example dito, sinasabi natin na row count modules or mod 10.

01:07:55.030 --> 01:07:58.570
So every 10 rows, mag-commit tayo ng transaction.

01:07:58.930 --> 01:08:00.890
So it committed after 10 rows.

01:08:03.170 --> 01:08:05.870
We can try it.

01:08:06.770 --> 01:08:08.590
We can use the department ID 10.

01:08:09.530 --> 01:08:12.730
So it is slide 210.

01:08:14.970 --> 01:08:19.350
Instead of 30, I think we have more department ID 10 in your record.

01:08:20.550 --> 01:08:23.270
So make it sure you have more rows.

01:08:23.270 --> 01:08:26.870
Let me know if you need more data in the employees.

01:08:27.550 --> 01:08:30.990
I can provide insert or you can insert more data.

01:08:32.270 --> 01:08:37.410
So basically ito yung gusto natin i-highlight, yung if-row-count mod.

01:08:37.510 --> 01:08:39.590
Nagkikita nyo dito, nag-commit siya.

01:08:39.790 --> 01:08:47.070
So ibig sabihin, kinok commit nya kapag 10 rows na, gagawin nyo na yung process nito.

01:08:48.630 --> 01:08:53.450
Please try the slide 210. Thank you.

01:08:56.070 --> 01:08:57.330
Hindi 10th row.

01:09:00.030 --> 01:09:01.810
Pag naka-sampong row na siya.

01:09:01.950 --> 01:09:04.070
So i-update nyo yung from 1 to 10.

01:09:05.350 --> 01:09:08.270
Tapos pap-process nyo uli yung 11, 12, 13.

01:09:08.730 --> 01:09:13.990
So konyari, hanggang 13 lang yung record mo, hindi nyo na mapap-process yung 11, 12, 13.

01:09:13.990 --> 01:09:17.950
Kasi hindi na siya pumasok doon sa pang-sampong row.

01:09:21.470 --> 01:09:24.330
Kasi di ba yung commit, yun yung nagpap-process ng transaction.

01:09:24.730 --> 01:09:27.050
But since in the final, we have the commit.

01:09:27.570 --> 01:09:35.450
So kung ano man yung naiiwan ni-commit dito, ikok-commit nyo pa din.

01:09:36.570 --> 01:09:47.570
Kumaka ang gustong ipakita dito is you can have a conditional commit after a set number of rows or after a certain condition na gusto nyo po.

01:10:07.850 --> 01:10:11.750
May error ka sir Miguel or hindi naman?

01:10:11.990 --> 01:10:14.770
Petch out of sequence daw ko sir.

01:10:14.950 --> 01:10:15.750
May see.

01:10:17.510 --> 01:10:18.330
Checking po.

01:10:18.850 --> 01:10:19.490
Okay.

01:10:25.230 --> 01:10:28.270
Petch out of sequence, let me check that.

01:10:31.190 --> 01:10:35.030
Sir, nag-update siya pero may error siyang binitaw.

01:10:35.930 --> 01:10:36.850
Sinipiling ka salita?

01:10:37.630 --> 01:10:38.710
Si Miguel po.

01:10:39.010 --> 01:10:40.090
Miguel, yes, yes.

01:10:40.290 --> 01:10:42.850
Anong error niya? Yung fresh out of sequence?

01:10:43.570 --> 01:10:45.390
Apo. Pero nag-update po yung table.

01:10:46.810 --> 01:10:48.530
Kasi nag-commit.

01:10:49.310 --> 01:10:49.830
Ay, o po.

01:10:51.730 --> 01:10:54.410
Kasi nag-commit tayo sa ending eh.

01:10:55.090 --> 01:10:59.430
Ang iba yung mga talagang siguro ko.

01:10:59.590 --> 01:11:02.970
Itas mo ka sir, at line 1 po. Pati nga anong line 1 mo sir.

01:11:04.830 --> 01:11:07.870
So we declare, curse your employee. One moment sir.

01:11:07.910 --> 01:11:09.830
Let me try your code really quick.

01:11:17.950 --> 01:11:20.950
Pati nga po ng error mo sir Miguel. Can you try it again?

01:11:22.290 --> 01:11:22.730
Okay po.

01:11:22.730 --> 01:11:26.490
Okay, one moment. Hold on.

01:11:27.370 --> 01:11:29.730
So at line 10.

01:11:33.670 --> 01:11:33.710
Okay.

01:11:33.990 --> 01:11:36.270
Yeah, that's fine. We can fix that.

01:11:39.310 --> 01:11:41.970
It says here yung fetch out of sequence.

01:11:42.650 --> 01:11:47.810
It's occur when a cursor fetch is attempted after the cursor has been closed.

01:11:47.810 --> 01:11:53.970
Or a work current of operation is performed on a cursor that is no longer valid.

01:11:55.070 --> 01:11:57.670
So in our case, for employee.

01:11:59.630 --> 01:12:01.910
Yung side effect niya po.

01:12:04.130 --> 01:12:06.070
Yes, one moment.

01:12:07.290 --> 01:12:08.990
Let me try my hand.

01:12:26.990 --> 01:12:30.230
Ayun niya sir. So parang anong nangyari.

01:12:30.590 --> 01:12:33.370
Kasi yung unang 10, nagcommit po di ba po?

01:12:33.590 --> 01:12:34.150
Yes.

01:12:34.270 --> 01:12:37.810
Parang unang 10, hindi niya nariksa yung parang konta na 10.

01:12:38.690 --> 01:12:41.230
Kaya siya nag throw ng error na ganito.

01:12:41.510 --> 01:12:43.350
Tapos wala tayong exception handler.

01:12:44.050 --> 01:12:44.710
Ayun po boys.

01:12:44.710 --> 01:12:49.710
So kung may exception handler tayo, we can catch that.

01:12:50.950 --> 01:12:51.270
Obo.

01:12:52.550 --> 01:12:55.230
Do you want to put exception handler into that code?

01:12:56.410 --> 01:12:57.510
Bade naman sir.

01:12:57.970 --> 01:12:58.670
Sige.

01:13:04.910 --> 01:13:05.830
Lagyan ko lang.

01:13:11.130 --> 01:13:12.010
So exception.

01:13:15.250 --> 01:13:18.710
Slide 210 with exception.

01:13:25.550 --> 01:13:28.490
Ok, I pasted na sa Google Sheet.

01:13:28.670 --> 01:13:30.370
So we declare cursor.

01:13:31.830 --> 01:13:33.130
Then nagbigay tayong update.

01:13:33.810 --> 01:13:35.950
So if commit mod 10.

01:13:37.370 --> 01:13:38.890
So we add exception.

01:13:39.250 --> 01:13:42.550
So when others error updating employee ID.

01:13:42.550 --> 01:13:45.550
So we try to roll back.

01:13:47.030 --> 01:13:47.810
Finally we commit.

01:13:48.150 --> 01:13:52.010
Pero pag nag-error pa rin din sa commit exception when others.

01:13:52.790 --> 01:13:54.830
Can you try with exception?

01:13:55.150 --> 01:13:57.450
Slide 210 with exception handling.

01:13:58.610 --> 01:13:59.030
Ok.

01:14:12.730 --> 01:14:18.250
Para malaman natin kung ang exception ba is dun sa inner for loop.

01:14:19.250 --> 01:14:20.770
Or sa labas na, sa outer.

01:14:21.810 --> 01:14:23.470
So using the exception handler.

01:14:24.750 --> 01:14:27.970
We can detect saan niyo nag-error.

01:14:35.050 --> 01:14:36.470
So dapat maresim natin.

01:14:36.550 --> 01:14:38.190
Unexpected error occurred.

01:14:39.730 --> 01:14:45.410
01002 fetch out of sequence.

01:14:50.650 --> 01:14:50.790
Yeah.

01:14:51.810 --> 01:14:52.350
Good, good.

01:14:52.910 --> 01:14:54.050
How about the others po?

01:14:55.770 --> 01:14:57.110
Sir Joseph, are you good?

01:14:57.650 --> 01:15:00.350
You're able to run the code with exception handling?

01:15:04.310 --> 01:15:05.410
Everything good?

01:15:05.590 --> 01:15:05.690
Ok.

01:15:05.750 --> 01:15:07.130
Let's move forward.

01:15:12.630 --> 01:15:13.390
So ito naman.

01:15:14.050 --> 01:15:16.550
It's a simple validation with statement.

01:15:18.270 --> 01:15:22.410
So it's on slide 210.

01:15:23.310 --> 01:15:25.190
We can quickly place it.

01:15:25.710 --> 01:15:27.990
Let's test it in 5 minutes.

01:15:28.150 --> 01:15:30.330
So pag hindi niya nakita or yung

01:15:31.570 --> 01:15:36.290
yung value is less than 3000

01:15:36.290 --> 01:15:37.990
which is yung 25.

01:15:38.670 --> 01:15:39.430
Mag-i-insert siya.

01:15:39.530 --> 01:15:41.710
So dapat mag-i-insert niya yung

01:15:41.710 --> 01:15:42.770
name na ilalagay niya doon.

01:15:42.790 --> 01:15:44.430
So it's possible na pag niran niyo ali

01:15:44.430 --> 01:15:46.330
magkakano kayo ng

01:15:46.850 --> 01:15:48.950
unique constraint validation

01:15:48.950 --> 01:15:50.730
or violation.

01:15:51.590 --> 01:15:53.290
So you have to change the employee ID.

01:15:53.630 --> 01:15:55.510
So slide 211.

01:15:55.550 --> 01:15:57.470
Tapos i-check niyo yung employee's table niyo

01:15:57.470 --> 01:15:59.070
kung nag-insert nga siya ng data.

01:16:04.590 --> 01:16:06.530
Try to change the name.

01:16:06.830 --> 01:16:09.550
The first name, last name, the name you like

01:16:09.550 --> 01:16:13.010
para mas makita niyo siya.

01:16:14.390 --> 01:16:16.190
Kasi I think we already have it diyan do.

01:16:17.530 --> 01:16:19.390
So try to change the name.

01:16:25.410 --> 01:16:30.470
So it is a simple validation

01:16:30.470 --> 01:16:32.330
with if statement.

01:16:33.770 --> 01:16:35.690
So again, we define the variables.

01:16:36.610 --> 01:16:42.090
Employee ID, first name, last name, and salary.

01:16:42.270 --> 01:16:43.950
So we use a validation check.

01:16:44.030 --> 01:16:46.510
If statement is to ensure that salary

01:16:46.510 --> 01:16:47.390
meets the minimum threshold.

01:16:47.670 --> 01:16:50.550
So if the salary is below 3,000,

01:16:50.670 --> 01:16:51.630
an error message is displayed

01:16:51.630 --> 01:16:54.050
and the insertion is skipped.

01:16:56.030 --> 01:16:58.330
So if the salary is valid,

01:16:58.630 --> 01:16:59.870
the employee data is inserted

01:16:59.870 --> 01:17:01.210
into the employee's table.

01:17:02.530 --> 01:17:04.530
So yung insert into employees,

01:17:05.350 --> 01:17:06.250
mag-i-effect siya.

01:17:06.750 --> 01:17:10.210
But I think EMP ID yung sa atin.

01:17:10.770 --> 01:17:11.790
EMP ID.

01:17:14.430 --> 01:17:15.990
So benefit of validation.

01:17:15.990 --> 01:17:17.730
First is data integrity.

01:17:17.750 --> 01:17:20.590
So it prevents valid or inconsistent data

01:17:20.590 --> 01:17:21.930
from entering the database.

01:17:23.030 --> 01:17:24.170
Also error prevention.

01:17:24.630 --> 01:17:27.130
So avoid runtime error caused by invalid data

01:17:27.130 --> 01:17:28.650
during database operation.

01:17:29.650 --> 01:17:30.670
And custom logic.

01:17:30.970 --> 01:17:32.870
It's allowed tailored validation rules

01:17:32.870 --> 01:17:34.870
based on business requirements.

01:17:35.910 --> 01:17:37.330
So validation using if statement

01:17:37.330 --> 01:17:40.110
ensures that operations are only performed

01:17:40.110 --> 01:17:44.690
when data meets specific criteria,

01:17:44.690 --> 01:17:47.190
safeguarding the integrity of your database.

01:17:48.890 --> 01:17:50.110
Let's move on.

01:17:50.570 --> 01:17:52.290
So itan naman yung

01:17:52.290 --> 01:17:53.910
ma-apply natin yung else if.

01:17:54.270 --> 01:17:57.730
So this is slide 212.

01:17:58.110 --> 01:17:58.790
Or 212.

01:17:59.990 --> 01:18:02.350
Can you quickly try it?

01:18:02.550 --> 01:18:04.730
Para ma-apply natin yung if, else if,

01:18:04.870 --> 01:18:07.210
else if, else, then end if.

01:18:08.430 --> 01:18:10.430
So don't forget the end if

01:18:10.430 --> 01:18:12.390
kapag magkakaroon ng if.

01:18:14.690 --> 01:18:16.490
I think we don't have,

01:18:16.510 --> 01:18:17.870
do we have a job title?

01:18:20.910 --> 01:18:22.350
Pero hindi naman kailangan kasi

01:18:22.350 --> 01:18:24.470
we're just declaring it here.

01:18:24.790 --> 01:18:27.110
So try the slides 212.

01:18:43.730 --> 01:18:46.050
Try to play with the numbers.

01:18:46.850 --> 01:18:49.390
Try to change the variable.

01:18:49.390 --> 01:18:51.610
...

01:19:19.390 --> 01:19:20.130
...

01:19:46.390 --> 01:19:46.830
Okay.

01:19:57.050 --> 01:20:03.910
yeah so let's move on so cursor parameters is allow you to pass

01:20:03.910 --> 01:20:09.390
values into cursor when it's open making cursor more flexible and

01:20:09.390 --> 01:20:14.010
reusable by using cursor parameter you can customize the behavior of the

01:20:14.360 --> 01:20:20.040
based on different inputs without redefining each time so when declaring a

01:20:20.040 --> 01:20:25.260
cursor you can specify one or more parameters each with a data type these

01:20:25.260 --> 01:20:29.180
parameters act like a function arguments and allow you to pass values

01:20:29.180 --> 01:20:34.460
into the cursor when you proceed so that the syntax is cursor name the

01:20:34.460 --> 01:20:39.040
name of the cursor then the parameter one parameter two and so on the

01:20:39.040 --> 01:20:45.980
of the cursor so each define with a specific data type then the select

01:20:45.980 --> 01:20:52.740
statement the SQL query that use the parameter so let's have an example of

01:20:52.740 --> 01:21:00.440
the cursor with single parameter can you please try the slide 214 please so

01:21:00.440 --> 01:21:06.280
again oh versus we declared the employee cursor is defined with depth

01:21:06.280 --> 01:21:15.000
ID or department ID so you see that is used in the work loss employee

01:21:15.000 --> 01:21:23.480
cursor depth ID number so you depth ID then the data type that was after non

01:21:23.480 --> 01:21:30.220
select employee ID so in our case EMP ID first name last name salary from

01:21:30.820 --> 01:21:38.080
department ID depth ID yeah so nakapag create a tie now cursor with a single

01:21:38.080 --> 01:21:42.900
parameter tapas we open open statement passes the parameter 10 so in

01:21:42.900 --> 01:21:47.740
this case since meron tayong department ID na 10 ma kapag open tayo

01:21:48.520 --> 01:21:53.800
tapos from that we can loop it na so fetch employee cursor into be

01:21:53.800 --> 01:21:59.940
employee first name last name tapos exit tayo kapag employee cursor not

01:21:59.940 --> 01:22:07.960
found are you able to run it successfully

01:22:15.100 --> 01:22:23.780
okay okay now let's try with multiple parameter that is on slide 215 now

01:22:23.780 --> 01:22:29.400
in our example so the purpose of that is the cursor employer cursor accept

01:22:29.400 --> 01:22:34.400
two parameters depth ID or the department ID and mean salary for

01:22:34.400 --> 01:22:40.740
minimum salary so the query is cursor employee cursor then depth ID number

01:22:40.740 --> 01:22:45.700
mean salary number so we open an employer cursor so

01:22:47.700 --> 01:22:55.340
department ID na 20 na may salary na minimum of 4000 so we select that

01:22:55.340 --> 01:22:59.540
kasi yung where natin department ID cost depth ID and salary is greater

01:23:00.500 --> 01:23:07.480
greater nor equal the minimum salary then we fetch and display the data

01:23:07.480 --> 01:23:15.720
okay process each row in the result so set individually using a loop and

01:23:15.720 --> 01:23:22.880
fetch then we close the cursor don't forget to close the cursor to release

01:23:22.880 --> 01:23:28.440
resources once processing is complete so our key points here is dynamic

01:23:28.440 --> 01:23:34.320
querying so cursor parameters allow the same cursor definition to be

01:23:34.320 --> 01:23:40.140
reused for different input values reducing redundancy also it offer

01:23:40.140 --> 01:23:44.900
flexibility parameters like depth ID and mean salary enable you to filter

01:23:44.900 --> 01:23:50.800
rows dynamically based on runtime inputs parameter data types it's a

01:23:50.800 --> 01:23:55.400
cursor parameter should match the data types in the query they do not

01:23:55.400 --> 01:24:01.900
require default values okay so in the in the number may default values open

01:24:01.900 --> 01:24:06.220
statement so when opening the cursor you must provide the values for all

01:24:06.220 --> 01:24:10.580
declared parameter in the correct order so cursor with multiple

01:24:10.580 --> 01:24:15.880
parameters enhance code reusability and flexibility allowing you to

01:24:15.880 --> 01:24:20.040
dynamically filter and process database on varying condition now

01:24:20.040 --> 01:24:28.280
let's look more advanced cursor using scenario oh yeah I so let's have a

01:24:28.280 --> 01:24:39.140
workshop so here's the task so you'll give in 40 minutes to do this then we

01:24:39.140 --> 01:24:46.460
have a break of 12 to 1 so I'm still here for until 12 if you have any

01:24:46.460 --> 01:24:54.260
question but let's do this task okay so we have a create our own cursor with

01:24:54.260 --> 01:25:00.200
parameters department ID and job title for the job title create na lang

01:25:00.200 --> 01:25:04.420
kayo ng job title dun sa department table pause ipakita nyo yung how we

01:25:04.420 --> 01:25:09.680
can fetch employee and matching the criteria if any question just ask long

01:25:09.680 --> 01:25:18.900
then create your own Google Docs paste your answer there and export as PDF

01:25:18.900 --> 01:25:25.820
then submit the submit the PDF once you have successfully run the code

01:25:25.820 --> 01:25:30.680
thank you

01:27:11.280 --> 01:27:14.540
Just message mo lang pag may question na, andito lang pa ako.

01:31:31.300 --> 01:31:32.700
Sorry.

01:35:37.280 --> 01:35:41.440
Hello po. Hello.

01:35:45.880 --> 01:35:50.440
Misun di ba may error tayo tapos sinasabi line ganito, line 2, line 3.

01:35:51.860 --> 01:35:55.440
Para makita natin or ma-enable natin sa worksheet, yung line number.

01:35:57.100 --> 01:36:00.260
Can you go to tools? On the menu, tools.

01:36:04.780 --> 01:36:05.400
Tapos preferences.

01:36:07.160 --> 01:36:10.200
Tapos hanapin natin yan yung code editor.

01:36:10.460 --> 01:36:12.160
Click natin yung plus.

01:36:15.940 --> 01:36:17.680
Tapos line gather.

01:36:19.600 --> 01:36:23.200
Line gather. Tapos i-check natin yung show line numbers.

01:36:24.340 --> 01:36:29.160
Para mas madali natin, madali tayo makapag-debug kung nasan yung line number na yan.

01:36:29.160 --> 01:36:30.120
Okay?

01:36:32.440 --> 01:36:35.180
Tools, preferences, line gather. Okay.

01:36:36.520 --> 01:36:37.880
I hope that helps.

01:36:44.120 --> 01:36:45.880
So siguro lunch na tayo.

01:36:46.960 --> 01:36:49.400
Balik tayo ng 1 p.m.

01:36:49.680 --> 01:36:52.460
So I'll give you 10 minutes pa to wrap up the code.

01:36:53.020 --> 01:36:55.260
So pagbalik nyo, let's wrap it up.

01:36:55.940 --> 01:36:58.180
Tapos review natin yung mga answer nyo.

01:36:58.180 --> 01:36:58.700
Okay?

01:36:59.600 --> 01:37:01.740
So enjoy your lunch, guys.

01:37:02.240 --> 01:37:04.260
Hello, ang busy talaga nila mag-coding, oh.

01:37:06.840 --> 01:37:07.860
Lunch mo na lunch.

01:37:08.600 --> 01:37:09.180
Thank you, ma'am.

01:37:09.360 --> 01:37:10.480
Okay, okay.

01:37:57.220 --> 01:37:57.900
Thank you, ma'am.

01:38:27.180 --> 01:38:27.900
Thank you, ma'am.

01:38:57.180 --> 01:38:57.900
Thank you, ma'am.

01:39:27.220 --> 01:39:27.900
Thank you, ma'am.

01:39:57.220 --> 01:39:57.920
Thank you, ma'am.

01:40:27.220 --> 01:40:27.900
Thank you, ma'am.

01:40:57.160 --> 01:40:57.920
Thank you, ma'am.

01:41:27.140 --> 01:41:27.900
Thank you, ma'am.

01:41:57.160 --> 01:41:57.900
Thank you, ma'am.

01:42:27.180 --> 01:42:27.900
Thank you, ma'am.

01:42:57.140 --> 01:42:57.900
Thank you, ma'am.

01:43:27.320 --> 01:43:27.900
Thank you, ma'am.

01:44:27.360 --> 01:44:27.880
Thank you, ma'am.

01:44:57.180 --> 01:44:57.920
Thank you, ma'am.

01:45:27.140 --> 01:45:27.900
Thank you, ma'am.

02:16:11.140 --> 02:16:21.340
okay please wrap up your workshop or your task I'll give you 10 more minutes

02:16:39.240 --> 02:16:43.340
yes po, yes po

02:16:47.160 --> 02:16:51.580
sa gawa po kayo ng google docs tapos sabi niya po sakin in pdf

02:16:51.580 --> 02:17:00.760
once you pay sa google docs you can download dito sa pdf tapos you can attach here or you can email it back to mamcha

02:17:08.460 --> 02:17:13.940
sir pwede konsolidate na lang po namin then pasun na lang namin via email

02:17:13.940 --> 02:17:15.560
okay no problem

02:17:21.660 --> 02:17:24.680
last 2 minutes

02:17:24.680 --> 02:17:37.900
okay so yeah i see na yung iba may ginawa pa but that's okay did you learn something while doing it

02:17:37.900 --> 02:17:49.820
so i'll send the answer and notes that you can use as well kapag i-apply nyo na

02:17:49.820 --> 02:17:59.500
but it's a good thing that you can also send your work email the work so i can evaluate tonight once you send to mamcha

02:17:59.500 --> 02:18:13.680
so please consolidate but i'll send it na and we will discuss it as well i'll send it in here

02:18:13.680 --> 02:18:30.560
so ito yung example code so you can run it later compare it to your answer then see the adjustment we have then also i provide an explanation on the task

02:18:30.560 --> 02:18:46.560
okay then we can discuss it by tomorrow morning ko may question or what are the difference but at least nakita nyo how we can use different

02:18:50.260 --> 02:19:00.560
function queries yung mga natutun natin at least na apply natin so let's continue the lesson i'm on now slide 216 out of 414

02:19:00.560 --> 02:19:07.700
so let's continue so ito yung answer niligay ko na rin sa google docs with explanation

02:19:10.860 --> 02:19:24.600
so additional okay we can do that later on but i think we can escape na kasi you know how the exception work roll back and you understand the row by row commit

02:19:24.600 --> 02:19:40.600
okay and this is also additional task but i think for time purposes let's escape this and you can you can do that we can do that this after if we have time tomorrow

02:19:44.100 --> 02:20:02.940
so let's discuss naman yung procedure function and packages when it comes to plsql pano tayong kikirit ng procedure ano ba yung function and packages have you ever created a procedure sa mysql po or function anyone

02:20:05.760 --> 02:20:31.960
na kapag kikirit na po kayo ng procedure functions na nung views okay that's fine yeah so i at least i know how we can tackle it or we can escape ko na ilat kayo na kapag

02:20:31.960 --> 02:20:56.340
okay so let's continue so since we already have a table employees no need to create that so let's proceed so let's try to create a sequence can you type this or if you want to copy paste it it's on the

02:20:57.480 --> 02:21:13.340
slide two two one so let's try to create a sequence it's in two two one then how gonna how we gonna use it i put the application there the insert into employees

02:21:16.420 --> 02:21:21.520
so yeah let's try to create a sequence

02:21:28.820 --> 02:21:34.520
so create mo na natin sequence pag nak create ng sequence saka tayo pwedeng gumamit ng insert into

02:21:36.880 --> 02:21:41.140
dapat may message kayo ma-receive na parang sequence created

02:21:53.040 --> 02:22:00.140
sequence emp underscore s-e-q-r-a-t-ed tapos tayo natin mag insert into

02:22:05.280 --> 02:22:18.140
so pag naka-receive tayo ng unique constraint ibig sabi niyo primary kisi natin is yung emp id which is yung next ball kasi yung sequence natin one two three sunun-sunod siya

02:22:18.380 --> 02:22:32.060
if you look at the employees table right now yeah so may ID na tayo na one so if you can edit it for now just for the testing purposes make it like 200 201

02:22:34.740 --> 02:22:45.060
sir Miguel i-back mo din i-back mo yung code mo doon yan tapos baguhin natin yung table mo na employees pwede tayo sa employees table

02:22:45.060 --> 02:23:00.060
tapos baguhin natin yung 126 mo baguhin natin yung 201 202 yung mula sa ano mo em 124 para makita natin na mag insert mamaya

02:23:00.060 --> 02:23:23.320
202-203-204 yung six yan ok tapos save commit ok then let's try to insert one row inserted tingnan natin kung nag insert punta ka po sa employees 15 refresh 16 na siya

02:23:23.320 --> 02:23:48.460
so nag to siya so mag-try ka po mag-insert so dapat ang susunod na ID 3 na yun ok natry nyo po nakita nyo po sir joseph nag-run po sa inyo yun kasi po yung ID na pinapasok natin ngayon is either one or two na meron ng existing kaya nag-account po kayo ng error

02:23:48.460 --> 02:24:06.320
if you can edit yung employees table po sir joseph go to your employees table tapos edit natin yan ganyan namin natin 201 202 ganun yung limang records na yun double click you can edit that

02:24:06.320 --> 02:24:18.680
gawin mo po ang 201 sir joseph ok then the next one ok perfect then commit the save and commit

02:24:20.440 --> 02:24:36.280
nag save po ba? ayun so refresh natin sir joseph refresh yes parang hindi nagdagdag no

02:24:39.840 --> 02:24:56.380
commit ok then let's try the code insert tayo ulit tingnan natin what happened yun so pang 4 na yung sequence natin can you try again to insert sir joseph tingnan natin kung magiging 5 na yung ID

02:24:56.940 --> 02:24:58.720
4 po yung lumabasok na

02:24:58.720 --> 02:25:03.900
ah 4 na so try ulit mag-insert i-run natin ulit yung command

02:25:07.620 --> 02:25:19.640
ok so 5 so ibig sabihin yung sequence gumagana ok so you can create more sequence if you need and you can increment by 2 by 3 or whatever number you like

02:25:19.640 --> 02:25:22.540
so let's proceed

02:25:24.780 --> 02:25:27.480
so ngayon naman try natin mag create ng view

02:25:29.860 --> 02:25:32.860
i think i prepared it as well

02:25:32.860 --> 02:25:36.780
on the line 222 let's create a view

02:25:36.780 --> 02:25:40.120
na-try nyo na po mag create ng view i mean before

02:25:40.640 --> 02:25:44.640
ah ok so yeah you can copy paste it

02:25:46.980 --> 02:25:48.020
yes po

02:25:48.020 --> 02:25:50.000
question po

02:25:50.000 --> 02:25:52.020
pano pag yung last value yung

02:25:52.620 --> 02:25:53.500
tadanda ka sa

02:25:54.340 --> 02:25:56.020
ano pong question po

02:25:58.760 --> 02:26:00.420
pano pag po yung

02:26:00.420 --> 02:26:02.020
ano yung last value po

02:26:02.560 --> 02:26:03.540
yung increment

02:26:05.920 --> 02:26:08.320
hindi ka nagagamit ng sequence

02:26:08.320 --> 02:26:11.360
gagamit ka na ng logic for example yung last

02:26:11.360 --> 02:26:13.480
ID nung

02:26:13.480 --> 02:26:15.740
nung table mo

02:26:15.740 --> 02:26:17.260
kumaga yung sequence

02:26:18.100 --> 02:26:19.740
function na built-in

02:26:20.820 --> 02:26:21.640
for

02:26:23.240 --> 02:26:24.060
kumaga

02:26:24.060 --> 02:26:25.740
yung sequence lang siya

02:26:27.180 --> 02:26:29.420
or pwede yung baguin yung sequence

02:26:29.420 --> 02:26:30.680
pwede rin

02:26:32.020 --> 02:26:32.840
yes

02:26:32.840 --> 02:26:36.060
oh yes so depende doon sa logic na gagawin mo

02:26:37.820 --> 02:26:38.640
yes

02:26:38.640 --> 02:26:41.740
ayun sa 10 lang po

02:26:42.620 --> 02:26:43.740
para mas

02:26:43.740 --> 02:26:47.940
para di na mag edit po nilang yung max value po

02:26:47.940 --> 02:26:50.200
then from there increment na lang

02:26:50.200 --> 02:26:51.180
pwede rin

02:26:52.700 --> 02:26:53.260
yes

02:26:54.040 --> 02:26:54.600
ok

02:26:59.940 --> 02:27:02.000
na-try nyo na po mag create ng value

02:27:02.000 --> 02:27:03.340
ah sorry ng view

02:27:03.340 --> 02:27:04.200
you can also

02:27:04.860 --> 02:27:05.420
ok

02:27:43.740 --> 02:27:46.080
para matawag natin siya

02:27:46.080 --> 02:27:46.700
diba

02:27:47.740 --> 02:27:49.500
to select it

02:27:49.500 --> 02:27:51.740
we can simply

02:27:59.620 --> 02:28:00.580
so

02:28:01.740 --> 02:28:02.780
creating view

02:28:03.740 --> 02:28:05.520
it's like a virtual table

02:28:05.520 --> 02:28:07.520
that is based on select query

02:28:07.520 --> 02:28:09.800
so it allows you to simplify

02:28:09.800 --> 02:28:11.800
complex queries or provide

02:28:11.800 --> 02:28:13.720
specific data subset

02:28:13.720 --> 02:28:14.440
to the user

02:28:14.440 --> 02:28:17.600
so now let's try to create a procedure

02:28:18.640 --> 02:28:19.800
so mag create naman

02:28:19.800 --> 02:28:21.500
tayo ngayon ng procedure

02:28:21.500 --> 02:28:23.800
by the way para magamit yung

02:28:24.580 --> 02:28:25.600
yung view

02:28:25.600 --> 02:28:27.860
you can simply select

02:28:27.860 --> 02:28:29.420
as there is from

02:28:29.420 --> 02:28:31.620
for example high underscore salary underscore

02:28:31.620 --> 02:28:32.660
employees

02:28:33.560 --> 02:28:34.640
tapos whatever

02:28:34.640 --> 02:28:36.580
yung laman ng view

02:28:36.580 --> 02:28:38.460
may kitang mas siya

02:28:38.460 --> 02:28:40.900
ngayon naman try natin mag

02:28:42.380 --> 02:28:44.400
hindi ko nilagay dyan

02:28:44.400 --> 02:28:46.160
but can you type

02:28:46.160 --> 02:28:47.560
this procedure

02:28:47.560 --> 02:28:49.100
update salary

02:28:55.360 --> 02:28:57.700
so yung procedure

02:28:58.460 --> 02:28:59.940
update the salary

02:29:00.460 --> 02:29:02.660
it's update the employee salary

02:29:02.660 --> 02:29:04.160
it takes two parameters

02:29:04.160 --> 02:29:06.820
one is yung employee ID

02:29:06.820 --> 02:29:08.920
and the new salary

02:29:08.920 --> 02:29:10.900
so in our case

02:29:12.660 --> 02:29:14.820
EMP underscore ID

02:29:28.980 --> 02:29:31.660
so ang application nya

02:29:31.660 --> 02:29:33.440
we can type

02:29:33.440 --> 02:29:34.800
begin update

02:29:34.800 --> 02:29:35.600
the salary

02:29:36.540 --> 02:29:38.460
tapos kung sila natin gusto kong i-update

02:29:38.460 --> 02:29:40.180
tapos kung ilan yung salary nyo

02:29:40.180 --> 02:29:41.840
i put that in the google sheet

02:29:41.840 --> 02:29:44.780
in the slides 223 application

02:29:45.540 --> 02:29:46.780
once na may procedure

02:29:46.780 --> 02:29:48.800
na kayo

02:30:01.540 --> 02:30:02.960
tapos check nyo yung tables

02:30:02.960 --> 02:30:04.940
check nyo kung nag-update yung

02:30:04.940 --> 02:30:06.240
once your

02:30:06.240 --> 02:30:08.120
kung nag-update yung salary

02:30:08.960 --> 02:30:10.720
so ibin sabi nag-run yung procedure

02:30:10.720 --> 02:30:11.840
ng TAMA

02:30:32.960 --> 02:30:33.380
so

02:31:04.960 --> 02:31:05.480
so

02:31:08.660 --> 02:31:08.960
so

02:31:10.060 --> 02:31:11.360
so

02:31:11.360 --> 02:31:12.880
so

02:31:30.480 --> 02:31:31.120
so

02:31:31.120 --> 02:31:32.920
the employee ID nya ang gamit natin sa

02:31:32.920 --> 02:31:34.940
table employees is EMP underscore

02:31:34.940 --> 02:31:35.380
ID

02:31:35.380 --> 02:31:37.600
make sure mapalita

02:31:37.600 --> 02:31:37.740
make sure mapalita

02:31:40.840 --> 02:31:44.920
So we're EMP Anuskar ID equals P Employee ID.

02:32:13.580 --> 02:32:19.280
Galing, no? Sir Joseph. Napalitan po yung five na may ano? Yan, five thousand. Si Adrian, no?

02:32:21.560 --> 02:32:22.600
Ya, ya.

02:32:24.500 --> 02:32:31.200
Tapos may kita mo rin yung procedure dun sa left if you want to see all the procedures.

02:32:37.780 --> 02:32:45.080
I mean if you want to see all the procedures. Also you can type describe then the procedure name.

02:32:45.320 --> 02:32:52.720
For example, describe update Anuskar salary to show the details of it.

02:32:53.960 --> 02:32:57.080
Yan, yan sir Joseph. May kitang mo din yan may procedure na ano?

02:33:27.080 --> 02:33:27.560
Sir Joseph.

02:33:27.560 --> 02:33:34.320
May kitang mo din yan may procedure na ano?

02:33:34.320 --> 02:33:40.300
Yan, yan sir Joseph. May kitang mo din yan may procedure na ano?

02:33:58.020 --> 02:34:01.560
Begin updates Anuskar salary.

02:34:02.460 --> 02:34:03.920
May procedure ka na sir Ray?

02:34:03.920 --> 02:34:06.860
Ah, okay. So it's already existing.

02:34:08.220 --> 02:34:13.180
Update salary where EMP Anuskar.

02:34:15.040 --> 02:34:18.380
System.update Anuskar salary.

02:34:18.980 --> 02:34:25.080
Update the set salary cause P new salary where EMP equals P Employee ID.

02:34:26.020 --> 02:34:28.420
May 101 ka ba na ID?

02:34:28.420 --> 02:34:32.520
Can you check yung table mo po na employees?

02:34:35.620 --> 02:34:37.060
Ah, okay.

02:34:38.440 --> 02:34:42.000
It's the number four. Okay.

02:34:42.640 --> 02:34:43.780
Try mga po ulit, Eran.

02:34:44.620 --> 02:34:47.420
Yung 15 to 18 na line, Eran.

02:34:49.560 --> 02:34:50.760
Baka tinignore niya kayo ano?

02:34:51.640 --> 02:34:53.180
Refresh? Can you refresh that?

02:34:56.100 --> 02:34:56.820
Okay.

02:34:57.200 --> 02:34:58.960
Can I see your query sir?

02:34:59.240 --> 02:35:00.380
On Local 12?

02:35:02.880 --> 02:35:04.500
Update salary.

02:35:05.000 --> 02:35:07.220
Dapat ko mana siya yung?

02:35:08.740 --> 02:35:10.980
P Employee ID.

02:35:12.600 --> 02:35:14.040
Create procedure.

02:35:14.180 --> 02:35:17.060
Ano ni pangalan ng procedure na mo sa Local 12?

02:35:18.240 --> 02:35:19.460
Update salary.

02:35:20.280 --> 02:35:24.920
Can we try to change maybe update salary one gano'n?

02:35:25.140 --> 02:35:26.180
Para makita lang natin.

02:35:26.220 --> 02:35:29.280
Tapos i-run mo siya para mag-create yung procedure.

02:35:31.040 --> 02:35:32.460
Okay. Tapos yung...

02:35:33.120 --> 02:35:33.820
Yan, okay.

02:35:34.000 --> 02:35:35.640
Nak-compile siya.

02:35:36.540 --> 02:35:36.900
Run.

02:35:38.500 --> 02:35:38.760
Yun.

02:35:38.840 --> 02:35:39.920
So nag-update siya.

02:35:40.060 --> 02:35:42.260
So hindi natin lang po nangyari din sa procedure, no?

02:35:46.640 --> 02:35:48.640
Siguro naka-filter ka.

02:35:48.660 --> 02:35:50.100
Sige, refresh natin yan.

02:35:50.520 --> 02:35:51.120
Procedures.

02:35:51.280 --> 02:35:52.400
Click mo nga po yung Local mo.

02:35:52.440 --> 02:35:54.500
Baka naka-filter ka po.

02:35:56.500 --> 02:35:57.480
Click mo yung Local mo.

02:35:57.500 --> 02:35:59.400
Tapos click mo yung Filter.

02:36:02.060 --> 02:36:03.440
Baka naka-filter ka.

02:36:04.780 --> 02:36:05.120
Yun.

02:36:06.480 --> 02:36:08.680
So may error ka dyan sa...

02:36:08.680 --> 02:36:10.580
Kasi naka-begin.

02:36:10.920 --> 02:36:12.240
So mali yung procedure.

02:36:12.840 --> 02:36:14.720
Naisama natin yung begin doon.

02:36:14.800 --> 02:36:16.240
So you can simply delete the...

02:36:18.140 --> 02:36:18.640
Okay.

02:36:21.840 --> 02:36:23.640
Okay. I think let's move on.

02:36:25.520 --> 02:36:27.240
Now let's try to...

02:36:27.960 --> 02:36:28.680
Ano naman?

02:36:28.780 --> 02:36:29.660
Create a function.

02:36:30.860 --> 02:36:32.700
So this time let's create a function.

02:36:32.980 --> 02:36:33.460
Really quick.

02:36:39.160 --> 02:36:40.280
It's on...

02:36:40.280 --> 02:36:42.320
224.

02:36:42.860 --> 02:36:44.240
Slides 224.

02:36:45.360 --> 02:36:46.280
I put application there.

02:36:47.160 --> 02:36:48.280
And another sample in PLSQL.

02:36:49.260 --> 02:36:50.140
PLSQL.

02:36:51.500 --> 02:36:53.500
Slides 224.

02:37:16.700 --> 02:37:20.500
So yung function sa PLSQL block,

02:37:21.100 --> 02:37:23.400
it performs a calculation or action

02:37:23.400 --> 02:37:25.600
and return a value.

02:37:26.020 --> 02:37:27.400
Functions are useful

02:37:27.400 --> 02:37:29.180
for encapsulating logic

02:37:29.180 --> 02:37:30.860
that needs to be reused.

02:37:32.240 --> 02:37:34.680
So this function, the calculation bonus,

02:37:34.840 --> 02:37:37.420
take a salary as an input

02:37:37.420 --> 02:37:39.220
and returns a calculated

02:37:39.220 --> 02:37:40.260
10% bonus.

02:37:40.260 --> 02:37:42.540
So I put the application as well

02:37:42.540 --> 02:37:44.260
in the slide 224.

02:37:46.080 --> 02:37:48.260
another sample in PLSQL

02:37:48.260 --> 02:37:49.660
sample.

02:37:50.900 --> 02:37:52.260
So we declare

02:37:54.480 --> 02:37:55.280
bsalary

02:37:55.280 --> 02:37:56.620
bbonus.

02:37:57.280 --> 02:37:58.080
Then we begin.

02:38:00.820 --> 02:38:02.360
Then we call to calculate

02:38:02.360 --> 02:38:04.200
the bonus. That is

02:38:04.200 --> 02:38:05.180
bbonus.

02:38:05.860 --> 02:38:07.800
We calculate the bbonus.

02:38:07.800 --> 02:38:10.380
And we display

02:38:10.380 --> 02:38:11.120
the result.

02:38:15.040 --> 02:38:16.080
Then we end.

02:38:17.860 --> 02:38:18.640
So we should have

02:38:18.640 --> 02:38:20.820
the output, the bonus salary of

02:38:20.820 --> 02:38:22.220
salary is

02:38:22.220 --> 02:38:23.240
then the bonus.

02:38:26.540 --> 02:38:27.180
Yes po.

02:38:28.140 --> 02:38:29.660
Sa function po,

02:38:30.300 --> 02:38:31.800
good practice po ba na

02:38:32.360 --> 02:38:33.740
mag return lang ng

02:38:33.740 --> 02:38:35.660
single value or specific

02:38:35.660 --> 02:38:37.540
value. Yes, it should return

02:38:37.540 --> 02:38:38.240
a value.

02:38:39.620 --> 02:38:41.660
Hindi siya parang procedure na

02:38:42.220 --> 02:38:43.140
may multiple

02:38:43.140 --> 02:38:45.760
operations sa noob po? Yes po.

02:38:46.000 --> 02:38:47.720
Kasi ang plan na natin sa function

02:38:47.720 --> 02:38:48.440
ma-reuse siya.

02:38:50.140 --> 02:38:51.780
Ah, so pwede siya ma-reuse

02:38:51.780 --> 02:38:53.180
inside the procedure din na po?

02:38:53.300 --> 02:38:54.360
Yes, yes.

02:39:10.200 --> 02:39:12.200
Siguro yung gusto kong

02:39:12.200 --> 02:39:13.680
iano sa function,

02:39:14.280 --> 02:39:15.320
iaboy natin yung side

02:39:15.320 --> 02:39:17.860
effect kasi yung function

02:39:17.860 --> 02:39:19.960
should not perform

02:39:19.960 --> 02:39:21.320
any database

02:39:21.320 --> 02:39:22.220
modification.

02:39:22.540 --> 02:39:24.160
Kung gusto mong may

02:39:24.160 --> 02:39:25.340
database modification,

02:39:25.620 --> 02:39:26.480
use procedure.

02:39:26.760 --> 02:39:27.880
Pero kung

02:39:28.700 --> 02:39:29.460
calculation,

02:39:30.580 --> 02:39:31.780
mga ganon,

02:39:31.960 --> 02:39:33.180
tapos it returns

02:39:33.180 --> 02:39:35.000
single data, single value,

02:39:35.440 --> 02:39:36.360
use function.

02:39:39.600 --> 02:39:41.280
let's remember the

02:39:41.280 --> 02:39:43.240
single responsibility principle.

02:39:44.760 --> 02:39:45.260
So meaning

02:39:45.260 --> 02:39:47.300
a function should not do

02:39:47.300 --> 02:39:49.280
one thing and should

02:39:49.280 --> 02:39:51.160
do one thing only and

02:39:51.160 --> 02:39:52.160
do it well.

02:39:54.440 --> 02:39:55.180
Basta ganyan niya

02:39:55.180 --> 02:39:57.240
yung function can be embedded

02:39:57.240 --> 02:39:58.980
sa mga SQL queries.

02:39:59.720 --> 02:40:01.300
So design them for

02:40:01.300 --> 02:40:01.940
performance.

02:40:02.340 --> 02:40:04.820
Let's avoid yung mga complex logic

02:40:04.820 --> 02:40:06.700
or multiple database calls

02:40:07.300 --> 02:40:08.740
sa loob ng function

02:40:09.300 --> 02:40:11.140
using SQL queries.

02:40:11.460 --> 02:40:13.600
Tapos ensure na they are

02:40:13.600 --> 02:40:15.100
deterministic to avoid

02:40:15.100 --> 02:40:17.180
performance issue with repeated calls

02:40:17.180 --> 02:40:18.780
in large data set.

02:40:19.960 --> 02:40:21.240
Tapos it's a good

02:40:21.240 --> 02:40:23.400
practice then to have exception

02:40:23.400 --> 02:40:25.440
handling sa loob

02:40:25.440 --> 02:40:27.320
ng function para

02:40:27.320 --> 02:40:29.280
kung may error man

02:40:29.280 --> 02:40:31.460
makapagbato siya ng messages

02:40:31.460 --> 02:40:33.240
and it avoid

02:40:33.240 --> 02:40:35.200
running runtimes error or calling

02:40:35.200 --> 02:40:35.840
blocks.

02:40:39.340 --> 02:40:39.360
And

02:40:39.360 --> 02:40:40.940
I think it's a good practice then

02:40:40.940 --> 02:40:43.280
to put comments like

02:40:43.280 --> 02:40:45.020
what is the purpose of the function?

02:40:45.580 --> 02:40:47.640
For example in our case we

02:40:47.640 --> 02:40:48.600
can comment

02:40:49.280 --> 02:40:51.080
function calculates the total bonds

02:40:51.080 --> 02:40:53.500
for an employee. Then we

02:40:53.500 --> 02:40:54.760
define the parameters.

02:40:55.200 --> 02:40:57.480
empid stands for employee

02:40:57.480 --> 02:40:59.560
empid. Then the returns

02:40:59.560 --> 02:41:01.400
the total bonds amount.

02:41:01.820 --> 02:41:03.980
This help us our colleague

02:41:03.980 --> 02:41:05.520
in your

02:41:05.520 --> 02:41:07.740
future self to remind

02:41:07.740 --> 02:41:09.360
what this function does.

02:41:10.280 --> 02:41:11.480
Okay, so since

02:41:11.480 --> 02:41:13.480
you tried the function, let's move on.

02:41:17.020 --> 02:41:17.500
So again

02:41:17.500 --> 02:41:18.140
summary

02:41:19.700 --> 02:41:21.580
SQL provides a variety

02:41:21.580 --> 02:41:23.680
of database object to organize and manage

02:41:23.680 --> 02:41:25.660
data in logic

02:41:25.660 --> 02:41:28.120
and logical effectively.

02:41:28.120 --> 02:41:29.860
So each object serves

02:41:29.860 --> 02:41:31.100
a unique purpose.

02:41:31.840 --> 02:41:33.020
Enhancing performance,

02:41:33.260 --> 02:41:35.060
reusability and security.

02:41:36.440 --> 02:41:38.100
First is we have table.

02:41:38.320 --> 02:41:39.480
We know table is

02:41:39.480 --> 02:41:40.660
structure data.

02:41:41.480 --> 02:41:43.640
We have sequence generate unique

02:41:43.640 --> 02:41:44.640
numeric values.

02:41:45.720 --> 02:41:47.420
It's commonly for primary keys.

02:41:48.580 --> 02:41:49.880
And it configure

02:41:49.880 --> 02:41:51.140
configurable to start the value.

02:41:51.940 --> 02:41:53.660
And also the increment step and the

02:41:53.660 --> 02:41:54.660
cycling option.

02:41:55.660 --> 02:41:57.760
Also the indexes, the purpose of that

02:41:57.760 --> 02:41:59.420
is to improve query performance

02:41:59.420 --> 02:42:02.000
by speeding up the data retrieval on

02:42:02.000 --> 02:42:03.500
a specific column especially

02:42:04.560 --> 02:42:05.940
millions of data.

02:42:06.460 --> 02:42:07.460
Then the views, the

02:42:07.460 --> 02:42:09.160
purpose of that is to create

02:42:09.160 --> 02:42:10.940
virtual tables

02:42:11.660 --> 02:42:13.480
for simplified and secure data

02:42:13.480 --> 02:42:13.980
access.

02:42:15.580 --> 02:42:17.680
So do not store data.

02:42:18.180 --> 02:42:19.760
They provide a query

02:42:19.760 --> 02:42:20.820
abstraction layer.

02:42:23.180 --> 02:42:24.820
For example create view, employee

02:42:24.820 --> 02:42:26.740
view as select first

02:42:26.740 --> 02:42:27.920
last name.

02:42:28.540 --> 02:42:30.820
Employees for salary greater

02:42:30.820 --> 02:42:32.620
than 4,000 for example.

02:42:33.580 --> 02:42:34.500
Then the procedure.

02:42:34.800 --> 02:42:36.820
So again it encapsulate reusable

02:42:36.820 --> 02:42:38.620
action to perform operation on

02:42:38.620 --> 02:42:40.780
database. So later on we

02:42:40.780 --> 02:42:43.160
will learn more about the procedure.

02:42:43.360 --> 02:42:44.760
The in and out.

02:42:45.040 --> 02:42:46.880
And the in out that allowing

02:42:46.880 --> 02:42:47.740
flexibility.

02:42:47.740 --> 02:42:50.460
So and lastly is the

02:42:50.460 --> 02:42:52.120
function. So it's for

02:42:52.120 --> 02:42:53.420
perform calculation operation

02:42:53.420 --> 02:42:55.400
and return a result.

02:42:57.220 --> 02:42:57.980
So marami pa tayong

02:42:57.980 --> 02:43:00.520
sample in the next slide.

02:43:03.760 --> 02:43:05.380
So here

02:43:06.380 --> 02:43:07.640
we have

02:43:07.640 --> 02:43:09.780
syntax for parameter procedure

02:43:09.780 --> 02:43:12.000
and function. So here

02:43:12.000 --> 02:43:13.740
we said param in

02:43:14.380 --> 02:43:16.780
yung param to out.

02:43:16.780 --> 02:43:18.420
Kisabihin mag output siya

02:43:18.420 --> 02:43:19.860
param 3 in out.

02:43:20.860 --> 02:43:22.820
Bibigyan ko na example niyan in a while.

02:43:23.260 --> 02:43:24.840
Then sa function. So we create

02:43:24.840 --> 02:43:26.900
a function param on in

02:43:26.900 --> 02:43:29.200
param to in

02:43:29.200 --> 02:43:30.740
tapos return

02:43:30.740 --> 02:43:32.120
anong yung data type?

02:43:32.780 --> 02:43:35.080
Return data type as

02:43:35.080 --> 02:43:37.020
tapos. So

02:43:37.020 --> 02:43:38.820
begin tayo na ato na yung return

02:43:38.820 --> 02:43:39.220
value.

02:43:40.880 --> 02:43:42.480
So let's try this.

02:43:42.860 --> 02:43:44.740
So let's try to create

02:43:44.740 --> 02:43:46.660
the procedure manage salary.

02:43:46.660 --> 02:43:48.600
So we calculate the bonus

02:43:48.600 --> 02:43:50.500
then we increase the salary.

02:43:52.440 --> 02:43:53.040
Let me check

02:43:53.040 --> 02:43:55.740
if I put that in the

02:43:55.740 --> 02:43:56.540
one moment.

02:43:59.840 --> 02:44:00.740
It's 227.

02:44:02.520 --> 02:44:03.060
Let's try

02:44:03.060 --> 02:44:04.600
this slide 227.

02:44:06.460 --> 02:44:06.820
Then on

02:44:06.820 --> 02:44:08.720
the google docs

02:44:08.720 --> 02:44:10.600
I also put the application

02:44:10.600 --> 02:44:12.720
and the trigger

02:44:12.720 --> 02:44:13.880
optional trigger.

02:44:14.380 --> 02:44:16.300
Because trigger will be discussed later on.

02:44:16.760 --> 02:44:18.820
But you can create your trigger now.

02:44:19.940 --> 02:44:21.000
Let's try it.

02:44:21.080 --> 02:44:23.120
Let's create the procedure manage salary.

02:44:24.360 --> 02:44:24.580
Again

02:44:24.580 --> 02:44:26.740
the employee ID. Let's

02:44:26.740 --> 02:44:28.740
replace it with EMP ID.

02:44:29.320 --> 02:44:30.760
If you see one. I'm going to highlight

02:44:30.760 --> 02:44:32.480
it so you can see.

02:44:48.640 --> 02:44:49.420
So

02:44:49.420 --> 02:44:50.340
if it is successful

02:44:50.340 --> 02:44:51.660
it should say procedure

02:44:51.660 --> 02:44:53.460
manage salary compiled.

02:44:57.480 --> 02:44:57.940
Then here's

02:44:57.940 --> 02:44:58.880
the application.

02:45:16.060 --> 02:45:17.040
Let me know

02:45:17.040 --> 02:45:17.960
if you can

02:45:17.960 --> 02:45:19.100
see the update salary

02:45:19.100 --> 02:45:20.720
for employee ID 101.

02:45:22.380 --> 02:45:23.340
Calculated bonus

02:45:23.340 --> 02:45:24.660
final salary.

02:45:27.820 --> 02:45:29.340
Try to call the procedure

02:45:29.340 --> 02:45:31.160
and check also the

02:45:31.160 --> 02:45:32.460
data in your database.

02:45:42.340 --> 02:45:43.400
One moment guys.

02:45:43.560 --> 02:45:44.980
I'll be right back 2 minutes.

02:46:31.440 --> 02:46:32.000
Thank you.

02:47:01.440 --> 02:47:02.000
Thank you.

02:47:31.440 --> 02:47:32.000
Thank you.

02:48:01.440 --> 02:48:02.000
Thank you.

02:48:02.460 --> 02:48:02.960
or

02:48:02.960 --> 02:48:04.360
Or

02:48:11.420 --> 02:48:12.820
or

02:48:22.220 --> 02:48:23.620
or

02:48:23.620 --> 02:48:24.820
Or

02:48:24.820 --> 02:48:25.000
Or

02:48:25.000 --> 02:48:25.020
Or

02:48:25.020 --> 02:48:25.040
Sorry

02:48:25.040 --> 02:48:27.320
I mute.

02:48:30.580 --> 02:48:31.980
Sorry.

02:48:32.580 --> 02:48:35.100
Yeah, yeah, yeah. Go ahead.

02:48:35.320 --> 02:48:37.660
Natry nyo na po pala. Yung ano po.

02:48:37.800 --> 02:48:40.200
Let's go back here in

02:48:42.300 --> 02:48:44.040
Yes po. Iraran po.

02:48:44.440 --> 02:48:46.160
Naran nyo na po. May procedure na po.

02:48:46.800 --> 02:48:48.420
Naran na po namin yung

02:48:48.420 --> 02:48:50.180
yung trigger po. Naran na rin po.

02:48:50.980 --> 02:48:52.640
Okay. Yung procedure po.

02:48:52.720 --> 02:48:53.700
Naran na rin po.

02:48:54.960 --> 02:48:56.140
Yung procedure po?

02:48:56.340 --> 02:48:57.740
Yes po. Na natry.

02:48:57.980 --> 02:48:59.120
Okay. Good.

02:48:59.120 --> 02:49:00.240
Bonus po.

02:49:02.160 --> 02:49:03.140
Yung po.

02:49:03.380 --> 02:49:04.940
Tapos yun. So create a

02:49:04.940 --> 02:49:06.960
function. So create

02:49:06.960 --> 02:49:09.120
a replace function. In this case

02:49:09.120 --> 02:49:11.120
we create

02:49:11.680 --> 02:49:12.460
sorry

02:49:13.120 --> 02:49:14.740
we calculate the total

02:49:14.740 --> 02:49:15.420
compensation.

02:49:17.100 --> 02:49:19.060
So the logic in this function

02:49:19.060 --> 02:49:20.940
is inside the begin block

02:49:20.940 --> 02:49:23.020
the function adds the salary

02:49:23.020 --> 02:49:24.800
in the P bonus parameter

02:49:24.800 --> 02:49:27.560
and return the

02:49:27.560 --> 02:49:28.780
result. Okay.

02:49:30.220 --> 02:49:31.600
So ang input natin dito

02:49:31.600 --> 02:49:33.580
yung salary and

02:49:33.580 --> 02:49:34.080
bonus.

02:49:36.480 --> 02:49:37.880
So function with parameters

02:49:37.880 --> 02:49:39.360
enables dynamic computation

02:49:39.360 --> 02:49:41.620
making them ideal for reusable

02:49:41.620 --> 02:49:43.780
and consistent logic

02:49:43.780 --> 02:49:45.360
and PL SQL programs.

02:49:46.040 --> 02:49:47.260
So let's see it in action.

02:49:47.600 --> 02:49:50.060
So here we declare salary, bonus

02:49:50.060 --> 02:49:51.580
then this is how

02:49:51.580 --> 02:49:53.300
we gonna use it.

02:49:53.860 --> 02:49:55.540
So we calculate

02:49:55.540 --> 02:49:56.600
the compensation

02:49:57.540 --> 02:49:58.880
b salary and b bonus

02:49:58.880 --> 02:50:01.100
the input. Then we

02:50:01.100 --> 02:50:03.580
display the total compensation.

02:50:04.720 --> 02:50:05.420
So here naman po

02:50:05.420 --> 02:50:07.480
yung parameter with

02:50:07.480 --> 02:50:09.520
cursor. So here

02:50:09.520 --> 02:50:11.140
we create a cursor,

02:50:11.480 --> 02:50:12.660
employer cursor

02:50:13.580 --> 02:50:15.480
so with a parameter

02:50:15.480 --> 02:50:17.560
p depth ID or department

02:50:17.560 --> 02:50:19.560
ID. Then the employee

02:50:19.560 --> 02:50:21.460
ID and salary. So we

02:50:21.460 --> 02:50:23.440
begin with

02:50:23.440 --> 02:50:25.280
open employee

02:50:26.180 --> 02:50:27.600
10. So meaning

02:50:27.600 --> 02:50:29.280
we're passing the 10

02:50:29.280 --> 02:50:31.340
here sa cursor

02:50:31.340 --> 02:50:33.480
employer cursor

02:50:34.280 --> 02:50:35.480
tapos ipapasa

02:50:35.480 --> 02:50:37.100
nyo dito. So

02:50:37.100 --> 02:50:39.200
mamimit nyo yung requirements kasi may department ID

02:50:39.200 --> 02:50:41.460
tayo na 10. So pag may

02:50:41.460 --> 02:50:43.540
may data tayo papasa ko sa loop

02:50:43.540 --> 02:50:45.200
so fetch

02:50:45.200 --> 02:50:47.300
employer cursor into employee ID

02:50:47.300 --> 02:50:49.340
salary. So sa ngayon inoutput

02:50:49.340 --> 02:50:51.220
lang natin yan but you can create

02:50:51.220 --> 02:50:53.260
your whatever the logic

02:50:53.260 --> 02:50:55.400
you want once you loop

02:50:55.400 --> 02:50:57.540
the data. So don't forget

02:50:57.540 --> 02:50:59.020
to close the employee

02:50:59.020 --> 02:50:59.560
cursor.

02:51:01.480 --> 02:51:03.100
So you can assign

02:51:03.100 --> 02:51:05.220
default values to parameter in the

02:51:05.220 --> 02:51:07.680
procedure and function. So for example

02:51:07.680 --> 02:51:09.580
create procedure

02:51:09.580 --> 02:51:11.600
example param1 in

02:51:11.600 --> 02:51:13.120
then the data type number

02:51:13.120 --> 02:51:15.160
then default nya is

02:51:15.160 --> 02:51:17.320
100. So multiple

02:51:17.320 --> 02:51:19.040
parameter types you can mix

02:51:19.040 --> 02:51:20.880
in out and in out

02:51:20.880 --> 02:51:23.040
parameters in a single sub program.

02:51:27.380 --> 02:51:29.040
So n number 3 is error

02:51:29.040 --> 02:51:31.200
handling with out

02:51:31.200 --> 02:51:33.140
and in out parameters.

02:51:33.700 --> 02:51:35.000
So ensure that out

02:51:35.000 --> 02:51:37.080
and in out parameters are always assigned a

02:51:37.080 --> 02:51:39.000
value within the sub program

02:51:39.000 --> 02:51:41.260
to avoid run times error.

02:51:42.420 --> 02:51:43.000
So benefit

02:51:43.000 --> 02:51:45.220
of that is prevent unhandled exception

02:51:45.220 --> 02:51:46.880
and ensure predictable outputs.

02:51:46.880 --> 02:51:48.900
So why parameters are

02:51:48.900 --> 02:51:50.980
important? First is dynamic

02:51:50.980 --> 02:51:52.920
code. It allows the sub program to

02:51:52.920 --> 02:51:54.800
adapt based on the input

02:51:54.800 --> 02:51:57.240
provided. Reusability

02:51:57.240 --> 02:51:59.060
same code can be used

02:51:59.060 --> 02:52:00.520
for different scenarios

02:52:00.520 --> 02:52:03.240
by passing parameter values

02:52:03.240 --> 02:52:04.980
and also maintainability

02:52:04.980 --> 02:52:07.000
it simplifies modification and

02:52:07.000 --> 02:52:09.180
enhancement by isolating

02:52:09.180 --> 02:52:11.060
logic with sub programs.

02:52:11.660 --> 02:52:13.020
Parameters enhance

02:52:13.020 --> 02:52:14.840
the flexibility and the reusability

02:52:14.840 --> 02:52:16.840
of PLSQL sub programs

02:52:17.420 --> 02:52:19.160
enabling you to create

02:52:19.160 --> 02:52:20.900
maintainable and dynamic solution

02:52:20.900 --> 02:52:22.680
that adapt to your various

02:52:22.680 --> 02:52:24.440
input and output.

02:52:25.420 --> 02:52:26.320
So here

02:52:26.840 --> 02:52:28.760
just the general structure of our

02:52:28.760 --> 02:52:30.780
procedure. So we create and replace a

02:52:30.780 --> 02:52:32.940
procedure then param1

02:52:32.940 --> 02:52:34.920
if it is in data

02:52:34.920 --> 02:52:36.860
type or if it is out

02:52:36.860 --> 02:52:38.760
or it's param

02:52:38.760 --> 02:52:40.280
is in out data type.

02:52:40.740 --> 02:52:42.860
Then the begin where we

02:52:42.860 --> 02:52:44.920
put the logic of the

02:52:44.920 --> 02:52:46.940
executable statement and exception

02:52:46.940 --> 02:52:48.880
then don't forget

02:52:48.880 --> 02:52:50.520
to end the procedure name.

02:52:50.600 --> 02:52:53.260
So first we declare

02:52:53.260 --> 02:52:54.860
then we execute

02:52:55.700 --> 02:52:57.140
so from begin

02:52:57.140 --> 02:52:59.160
we execute

02:52:59.160 --> 02:53:01.180
whatever we want to execute

02:53:01.180 --> 02:53:03.360
for example this one

02:53:03.360 --> 02:53:04.860
we update

02:53:05.420 --> 02:53:06.840
the employee salary plus

02:53:06.840 --> 02:53:08.780
by barnard we employ the ID

02:53:08.780 --> 02:53:10.860
equals PMID. Then

02:53:10.860 --> 02:53:12.960
the exception, so it handle

02:53:12.960 --> 02:53:14.820
run times early decor during execution

02:53:14.820 --> 02:53:16.600
of the program when

02:53:18.420 --> 02:53:20.100
no data pound

02:53:20.860 --> 02:53:22.860
sabi niya no record pound.

02:53:28.160 --> 02:53:28.900
Then here's

02:53:28.900 --> 02:53:30.840
the example of creating

02:53:30.840 --> 02:53:33.300
update employee salary

02:53:36.860 --> 02:53:38.120
So here

02:53:38.120 --> 02:53:40.220
we have a parameter of

02:53:40.220 --> 02:53:42.160
input employee ID

02:53:42.160 --> 02:53:44.120
and increase percentage

02:53:45.960 --> 02:53:48.360
the percentage we need to increase

02:53:48.360 --> 02:53:50.260
the salary then we have the

02:53:50.260 --> 02:53:52.080
output parameter the P new

02:53:52.080 --> 02:53:54.200
salary as an out

02:53:54.200 --> 02:53:56.120
and P bonus an out

02:53:56.120 --> 02:53:57.940
so it's return the updated

02:53:57.940 --> 02:54:00.000
salary after applying the increase

02:54:00.000 --> 02:54:02.160
and P bonus return the

02:54:02.160 --> 02:54:04.280
calculated bonus based on the

02:54:04.280 --> 02:54:05.380
new salary.

02:54:05.380 --> 02:54:07.380
So in the declaration section

02:54:07.960 --> 02:54:09.840
we use V current salary

02:54:09.840 --> 02:54:11.380
a local variable used to temporarily

02:54:11.900 --> 02:54:13.380
store the employee's

02:54:13.900 --> 02:54:15.520
current salary. Then

02:54:15.520 --> 02:54:17.540
for the executable section

02:54:17.540 --> 02:54:19.420
we fetch the current

02:54:19.420 --> 02:54:21.420
salary the select

02:54:21.420 --> 02:54:23.720
into statement retrieves the

02:54:23.720 --> 02:54:25.520
current salary of the employee

02:54:25.520 --> 02:54:26.620
here.

02:54:27.760 --> 02:54:29.380
Then we calculate the new salary

02:54:31.380 --> 02:54:33.280
so the salary is updated by applying

02:54:33.280 --> 02:54:35.040
the percentage increase here

02:54:35.040 --> 02:54:37.500
we add the

02:54:37.500 --> 02:54:38.860
percentage increase

02:54:38.860 --> 02:54:41.340
then we calculate the bonus

02:54:41.340 --> 02:54:43.720
the bonus is calculated as 10%

02:54:43.720 --> 02:54:45.320
of the new salary

02:54:45.320 --> 02:54:47.620
so whatever the new salary

02:54:47.620 --> 02:54:49.240
times .10 or

02:54:49.240 --> 02:54:51.560
10%

02:54:51.560 --> 02:54:53.320
then updated statement

02:54:53.320 --> 02:54:55.440
the updated salary is written

02:54:55.440 --> 02:54:56.740
back to the database

02:54:57.280 --> 02:54:58.840
so we update that employee

02:54:58.840 --> 02:55:01.360
we set the salary to the new salary

02:55:01.360 --> 02:55:03.360
with all this calculation

02:55:04.380 --> 02:55:05.720
then we

02:55:05.720 --> 02:55:07.120
do exception handling

02:55:07.120 --> 02:55:08.760
kapag walang nakita

02:55:09.360 --> 02:55:11.180
no data found so

02:55:11.180 --> 02:55:13.360
i-file nyo yung error employee ID

02:55:14.000 --> 02:55:15.400
when others

02:55:15.400 --> 02:55:17.040
unexpected error occur

02:55:17.040 --> 02:55:19.640
so hindi natin

02:55:19.640 --> 02:55:21.240
kumaga i-calculate lang natin yung error

02:55:21.240 --> 02:55:22.660
para makita natin kung saan

02:55:23.360 --> 02:55:24.920
ano yung mali.

02:55:29.220 --> 02:55:30.420
So again

02:55:30.420 --> 02:55:31.680
calling the procedure

02:55:31.680 --> 02:55:32.980
so we declare

02:55:34.720 --> 02:55:35.520
this

02:55:37.320 --> 02:55:38.320
this is

02:55:38.320 --> 02:55:39.660
how we call the procedure

02:55:39.660 --> 02:55:42.400
as we practice a while ago

02:55:43.740 --> 02:55:44.540
then

02:55:44.540 --> 02:55:45.360
types of error

02:55:45.360 --> 02:55:47.540
in PLSQL so syntax

02:55:47.540 --> 02:55:48.200
error

02:55:48.200 --> 02:55:50.460
occur during compilation

02:55:50.460 --> 02:55:51.820
due to incorrect syntax

02:55:51.820 --> 02:55:53.200
so mandalis natin

02:55:53.200 --> 02:55:55.140
itong nakita

02:55:55.140 --> 02:55:56.720
then runtimes error

02:55:56.720 --> 02:55:58.980
occur during execution due to invalid

02:55:58.980 --> 02:56:01.340
operation or wrong input

02:56:01.340 --> 02:56:03.360
such as division by zero

02:56:03.360 --> 02:56:04.900
or a missing table

02:56:04.900 --> 02:56:07.040
so logical errors as well

02:56:07.040 --> 02:56:09.220
it cause unexpected behavior due to

02:56:09.220 --> 02:56:10.860
incorrect logic in the code

02:56:10.860 --> 02:56:13.140
so example of syntax error

02:56:13.140 --> 02:56:15.260
so for example this one

02:56:15.260 --> 02:56:16.220
we begin

02:56:17.380 --> 02:56:19.180
so it says

02:56:19.180 --> 02:56:21.260
00201 identifier

02:56:21.260 --> 02:56:23.260
dbms put outline must be declared

02:56:25.020 --> 02:56:26.760
so type po kasi sya

02:56:26.760 --> 02:56:28.680
dapat put underscore line

02:56:29.260 --> 02:56:30.720
so ang solution natin

02:56:30.720 --> 02:56:31.900
lagin natin na underscore

02:56:33.040 --> 02:56:35.040
sample naman ng runtime error

02:56:35.040 --> 02:56:36.680
so nagdeclare tayo ng

02:56:37.640 --> 02:56:39.260
v0 be result number

02:56:39.800 --> 02:56:41.260
tas we're trying to divide

02:56:42.140 --> 02:56:43.280
by zero

02:56:43.280 --> 02:56:44.640
yung number

02:56:45.260 --> 02:56:47.460
result to divisor is equals to zero

02:56:47.460 --> 02:56:49.100
so ang solution natin

02:56:49.100 --> 02:56:51.100
is magkaran tayo ng exception handling

02:56:52.980 --> 02:56:53.100
so

02:56:53.700 --> 02:56:55.320
nagbigin tayo tas nagdagtag tayo

02:56:55.320 --> 02:56:57.300
ng exception when zero divide

02:56:57.300 --> 02:56:59.260
then dbms output

02:56:59.260 --> 02:57:01.100
put line cannot divide by zero

02:57:01.940 --> 02:57:03.200
or you

02:57:03.200 --> 02:57:04.900
can log it in the database

02:57:04.900 --> 02:57:07.480
gano din pag no data

02:57:07.480 --> 02:57:09.180
found so we add

02:57:09.180 --> 02:57:10.300
an exception

02:57:11.100 --> 02:57:12.960
pag no data found

02:57:12.960 --> 02:57:15.240
just put or output this

02:57:15.240 --> 02:57:17.120
or put that in your

02:57:17.120 --> 02:57:18.180
error lag

02:57:19.120 --> 02:57:21.020
pag yeah pag too many rows

02:57:21.020 --> 02:57:22.480
for example

02:57:22.480 --> 02:57:26.800
when we

02:57:26.800 --> 02:57:29.040
so that error message 01

02:57:29.040 --> 02:57:30.480
422

02:57:31.120 --> 02:57:32.800
the exact fetch return more than

02:57:32.800 --> 02:57:34.620
requested number of errors

02:57:34.620 --> 02:57:36.560
because the cause is

02:57:36.560 --> 02:57:38.440
the select enter statement is designed to fetch

02:57:39.120 --> 02:57:39.860
exactly one row

02:57:39.860 --> 02:57:42.140
when there were close matches

02:57:42.140 --> 02:57:44.820
multiple rows this error is raised

02:57:44.820 --> 02:57:46.000
okay

02:57:46.000 --> 02:57:48.220
so ang solution natin yan

02:57:48.820 --> 02:57:49.860
is

02:57:50.820 --> 02:57:52.020
pwede tayo mag limit

02:57:52.020 --> 02:57:54.280
or pwede tayo

02:57:54.280 --> 02:57:55.560
mag use ng cursor

02:57:56.820 --> 02:57:58.460
so mag exit tayo when empty

02:57:58.460 --> 02:58:00.860
cursor not found

02:58:00.860 --> 02:58:02.820
or pwede natin

02:58:03.360 --> 02:58:04.820
ilimit kanyari

02:58:04.820 --> 02:58:06.820
per department

02:58:06.820 --> 02:58:07.800
id

02:58:08.800 --> 02:58:11.120
and row num equals one

02:58:11.120 --> 02:58:12.960
so pwede tayong mag limit

02:58:15.520 --> 02:58:17.360
then here is how

02:58:17.360 --> 02:58:19.060
you do debugging

02:58:19.060 --> 02:58:21.000
using put line

02:58:21.000 --> 02:58:22.960
so dbms output

02:58:22.960 --> 02:58:23.920
put line

02:58:24.820 --> 02:58:27.000
which is ginagawa naman natin

02:58:27.000 --> 02:58:29.100
tapos ito yung na practice natin

02:58:29.100 --> 02:58:31.100
yesterday yung pag

02:58:31.100 --> 02:58:32.660
lalagay ng sql code

02:58:32.660 --> 02:58:35.000
and sql err

02:58:35.000 --> 02:58:36.540
errm

02:58:36.540 --> 02:58:38.940
which is built in

02:58:38.940 --> 02:58:40.820
commands sa

02:58:41.840 --> 02:58:42.820
plsql oracle

02:58:42.820 --> 02:58:43.100
database

02:58:47.100 --> 02:58:48.960
then key characteristic

02:58:48.960 --> 02:58:50.400
of pro procedure

02:58:50.400 --> 02:58:53.240
inga encapsulation combines logic

02:58:53.240 --> 02:58:54.900
into reusable unit

02:58:54.900 --> 02:58:56.840
can accept

02:58:56.840 --> 02:58:58.700
input in

02:58:58.700 --> 02:59:00.940
out or both in and out

02:59:00.940 --> 02:59:01.900
data type

02:59:03.240 --> 02:59:04.780
then here's the

02:59:04.780 --> 02:59:05.720
example

02:59:07.340 --> 02:59:08.180
okay

02:59:08.180 --> 02:59:10.860
can we try this? I didn't put

02:59:10.860 --> 02:59:12.200
that in the

02:59:12.200 --> 02:59:14.720
since this is make me lang naman

02:59:14.720 --> 02:59:16.860
can you type this in your

02:59:17.460 --> 02:59:18.860
desktop please

02:59:21.240 --> 02:59:22.660
para matari natin

02:59:22.660 --> 02:59:24.840
yung with parameters

02:59:30.860 --> 02:59:33.300
so type creator replace procedure

02:59:33.300 --> 02:59:34.700
calculate area

02:59:46.360 --> 02:59:47.360
okay

02:59:47.360 --> 02:59:48.680
okay i'll try to put that

02:59:48.680 --> 02:59:49.520
in the document

02:59:49.520 --> 02:59:52.860
it will be line 244

02:59:56.860 --> 02:59:57.780
so example

02:59:58.860 --> 03:00:00.400
create or replace

03:00:00.400 --> 03:00:01.760
calculate area

03:00:01.760 --> 03:00:03.520
so we declare length

03:00:06.860 --> 03:00:08.080
then we begin

03:00:11.420 --> 03:00:12.880
then we declare

03:00:12.880 --> 03:00:14.360
rec number

03:00:14.360 --> 03:00:16.020
calculate area

03:00:16.020 --> 03:00:18.860
lalagay ko na sa slide 244

03:00:52.200 --> 03:00:54.600
so don't forget to end

03:00:54.600 --> 03:00:56.160
once you declare

03:00:56.160 --> 03:00:56.820
the procedure

03:00:56.820 --> 03:00:58.860
so for example you create

03:00:58.860 --> 03:01:00.440
procedure calculate area

03:01:00.440 --> 03:01:01.700
you have to end

03:01:01.700 --> 03:01:03.320
the name calculate area

03:01:09.540 --> 03:01:10.220
so

03:01:10.220 --> 03:01:10.380
so

03:01:10.380 --> 03:01:10.400
so

03:01:17.760 --> 03:01:18.020
so

03:01:39.520 --> 03:01:39.780
okay

03:01:39.780 --> 03:01:39.860
so

03:01:39.860 --> 03:01:39.920
okay

03:01:39.920 --> 03:01:39.940
okay

03:01:39.940 --> 03:01:40.120
so

03:03:02.360 --> 03:03:10.100
I put the correct code in the document.

03:03:15.960 --> 03:03:23.060
Pag successfully compiled, procedure calculate area compiled.

03:04:21.460 --> 03:04:30.820
Once the procedure compiled, you can call it by begin the calculate area.

03:04:38.820 --> 03:04:42.820
Calculate area po may space po.

03:04:44.260 --> 03:04:47.780
May show yung line number mo para mas madali natin makita.

03:04:54.740 --> 03:05:01.760
At line for 1234 cannot be used on assignment target.

03:05:02.880 --> 03:05:05.720
So declare rec area number.

03:05:12.140 --> 03:05:17.100
Once na ma-create na yung procedure, pwede mo siya erase.

03:05:19.660 --> 03:05:26.280
Line for 1234, yung calculate r-score area, column one.

03:05:27.280 --> 03:05:31.560
May procedure yun na ba ikaw? Calculate area? Ayun, calculate area.

03:05:31.560 --> 03:05:36.120
Patingin na po ng calculate area mo, sir Miguel.

03:05:38.460 --> 03:05:44.840
Create or replace non-editional procedure.

03:05:44.840 --> 03:05:47.720
Can you remove mo na yung non-editional?

03:05:48.760 --> 03:06:08.100
Yun number out with...

03:06:08.100 --> 03:06:08.700
Ayun po, sir.

03:06:08.860 --> 03:06:09.340
Yes po.

03:06:10.980 --> 03:06:12.780
Ata po yung pa si...

03:06:12.780 --> 03:06:15.120
Si sir Miguel, pa ito ng kasadita.

03:06:16.640 --> 03:06:17.500
Ayos po.

03:06:17.660 --> 03:06:20.040
Ayos po, sir Miguel. Game. Nakatingin pa ko sa screen mo.

03:06:20.140 --> 03:06:26.260
Pwede mong alisin yung non-editional na word. Not sure with that.

03:06:27.840 --> 03:06:29.200
Dun po sa line one.

03:06:31.640 --> 03:06:37.860
Yung non-editional, yun sa line one mo.

03:06:37.860 --> 03:06:41.280
It should be create or replace procedure.

03:06:41.320 --> 03:06:42.660
Yan, just remove that.

03:06:42.860 --> 03:06:50.300
Procedure calculate area na grun.

03:06:54.340 --> 03:06:57.980
In, out, in, number is...

03:06:57.980 --> 03:07:02.200
Can you try to create procedure another, sir Miguel?

03:07:02.320 --> 03:07:04.400
Tapos copy mo yung ano ko?

03:07:05.580 --> 03:07:07.680
Yung nasa Google.

03:07:07.800 --> 03:07:10.380
Tapos laging natin calculate area 2.

03:07:10.740 --> 03:07:13.280
Para we can have a comparison.

03:07:26.400 --> 03:07:28.180
Wow, si ma'am Tin. Tapos na.

03:07:31.840 --> 03:07:33.920
Yan, si sir Ray.

03:07:34.540 --> 03:07:36.300
Nakita ko na rin, okay na.

03:07:37.420 --> 03:07:39.320
Si sir Jerry, ganun din.

03:07:40.920 --> 03:07:42.500
Sir Joseph, narun mo na po.

03:07:43.700 --> 03:07:46.060
I mean, nakapag-calculate na siya.

03:07:46.680 --> 03:07:47.180
Yan, okay.

03:07:48.000 --> 03:07:49.180
Sir Miguel na lang.

03:07:50.380 --> 03:07:51.180
Create or replace procedure.

03:07:51.940 --> 03:07:54.420
Calculate area. I think it's look good.

03:07:56.240 --> 03:07:56.780
Okay.

03:07:56.780 --> 03:07:59.000
It compiled good.

03:07:59.000 --> 03:08:01.600
Let's try to run it.

03:08:02.480 --> 03:08:02.720
Awesome.

03:08:04.780 --> 03:08:07.100
Awesome, awesome.

03:08:07.660 --> 03:08:08.460
Thank you po.

03:08:08.980 --> 03:08:09.700
Welcome po.

03:08:10.420 --> 03:08:15.720
Yan, so eto naman yung with in out na parameters.

03:08:17.340 --> 03:08:18.180
And with in.

03:08:19.260 --> 03:08:25.280
So let me put this in the...

03:08:25.280 --> 03:08:27.740
So let's try to create this procedure.

03:08:27.780 --> 03:08:32.700
I'll try to put this in the Google sheet.

03:08:33.140 --> 03:08:33.700
One moment.

03:08:34.560 --> 03:08:37.280
This will be slide 245.

03:08:41.420 --> 03:08:43.600
So let's create a procedure.

03:08:44.180 --> 03:08:44.880
One moment.

03:08:48.160 --> 03:08:51.100
So increment value, the input and output parameter.

03:08:54.780 --> 03:08:55.100
Then...

03:08:55.660 --> 03:08:56.960
Then the exception.

03:08:57.520 --> 03:08:59.460
So I add another...

03:08:59.460 --> 03:09:01.100
When others...

03:09:02.040 --> 03:09:04.200
Then it will raise an application error.

03:09:05.140 --> 03:09:08.140
Then we increment the value.

03:09:09.280 --> 03:09:13.100
So here...

03:09:14.040 --> 03:09:15.560
We can do application.

03:09:15.560 --> 03:09:20.880
And so mag-declare tayo ng current value.

03:09:21.480 --> 03:09:22.900
Tapos increment.

03:09:24.440 --> 03:09:25.340
Then we begin.

03:09:25.700 --> 03:09:27.560
We call the procedure increment value.

03:09:28.480 --> 03:09:33.040
So num equals current value increment by then increment.

03:09:33.220 --> 03:09:34.660
Then we display the output.

03:09:35.760 --> 03:09:36.220
Okay.

03:09:36.220 --> 03:09:38.280
So let's try to create the procedure.

03:09:39.240 --> 03:09:41.160
In slides 245.

03:10:10.200 --> 03:10:10.720
So let me put this in the Google sheet.

03:10:10.720 --> 03:10:10.880
So let's try to create the procedure.

03:10:40.880 --> 03:10:41.460
...

03:10:41.460 --> 03:10:42.060
...

03:10:42.060 --> 03:10:43.220
...

03:10:43.220 --> 03:10:45.140
...

03:10:45.140 --> 03:10:45.780
...

03:10:45.780 --> 03:10:46.600
...

03:10:46.600 --> 03:10:46.740
...

03:10:46.740 --> 03:10:46.800
...

03:10:46.800 --> 03:10:46.860
...

03:11:13.100 --> 03:11:14.500
...

03:11:14.500 --> 03:11:16.020
...

03:11:33.260 --> 03:11:34.660
...

03:11:34.660 --> 03:11:34.760
...

03:11:59.760 --> 03:12:01.160
...

03:12:22.060 --> 03:12:23.460
...

03:12:52.040 --> 03:12:53.440
...

03:12:54.440 --> 03:12:56.140
...

03:12:56.140 --> 03:12:56.440
...

03:13:52.020 --> 03:13:53.420
...

03:13:53.420 --> 03:13:54.500
...

03:13:54.500 --> 03:13:55.560
...

03:13:55.560 --> 03:13:55.840
...

03:13:55.840 --> 03:13:56.520
...

03:13:56.520 --> 03:13:57.560
...

03:13:59.620 --> 03:14:01.020
...

03:14:01.020 --> 03:14:01.040
...

03:14:01.040 --> 03:14:01.060
...

03:14:06.860 --> 03:14:08.260
...

03:14:09.260 --> 03:14:10.520
...

03:14:10.520 --> 03:14:11.060
...

03:14:11.060 --> 03:14:11.620
...

03:14:13.900 --> 03:14:15.020
...

03:14:15.020 --> 03:14:15.220
...

03:14:15.220 --> 03:14:16.480
...

03:14:16.480 --> 03:14:17.600
...

03:14:19.200 --> 03:14:20.600
...

03:14:23.160 --> 03:14:24.560
...

03:14:29.400 --> 03:14:30.800
...

03:14:30.800 --> 03:14:31.880
...

03:14:31.880 --> 03:14:32.340
...

03:14:32.340 --> 03:14:32.580
...

03:14:32.580 --> 03:14:32.760
...

03:14:32.760 --> 03:14:33.040
...

03:14:33.040 --> 03:14:33.260
...

03:14:33.260 --> 03:14:33.480
...

03:14:33.480 --> 03:14:33.720
...

03:14:33.720 --> 03:14:33.960
...

03:14:56.080 --> 03:14:57.480
...

03:14:57.480 --> 03:14:58.380
...

03:14:58.380 --> 03:15:01.020
...

03:15:01.020 --> 03:15:01.040
...

03:15:03.900 --> 03:15:05.300
...

03:15:10.920 --> 03:15:12.320
...

03:15:20.860 --> 03:15:22.260
...

03:15:22.260 --> 03:15:23.640
...

03:15:23.640 --> 03:15:23.920
...

03:15:32.400 --> 03:15:32.840
...

03:15:32.840 --> 03:15:32.880
...

03:15:32.880 --> 03:15:33.100
...

03:15:33.100 --> 03:15:35.860
...

03:15:35.860 --> 03:15:36.040
...

03:15:41.600 --> 03:15:43.000
...

03:15:43.000 --> 03:15:43.040
...

03:15:44.840 --> 03:15:46.240
...

03:15:46.240 --> 03:15:46.260
...

03:15:46.260 --> 03:15:47.380
...

03:15:52.320 --> 03:15:53.720
...

03:15:53.720 --> 03:15:53.740
...

03:15:53.740 --> 03:15:55.240
...

03:15:55.240 --> 03:15:55.680
...

03:15:55.680 --> 03:15:57.220
...

03:16:06.620 --> 03:16:08.020
...

03:16:09.860 --> 03:16:11.260
...

03:16:11.260 --> 03:16:13.880
...

03:16:13.880 --> 03:16:14.520
...

03:16:14.520 --> 03:16:15.320
...

03:16:15.320 --> 03:16:16.500
...

03:16:16.500 --> 03:16:19.280
...

03:16:19.280 --> 03:16:21.700
...

03:16:21.700 --> 03:16:22.460
...

03:16:32.320 --> 03:16:32.640
...

03:16:32.640 --> 03:16:33.500
...

03:16:43.900 --> 03:16:45.300
...

03:16:45.300 --> 03:16:52.800
sql plus you can also do or execute a function like in this or procedure in this instance

03:16:52.800 --> 03:16:55.500
We use exec gets alert

03:16:55.500 --> 03:16:56.680
then

03:16:56.680 --> 03:17:01.820
displaying result will DMS put outline so in this case we

03:17:02.840 --> 03:17:06.180
output the employee name and

03:17:06.180 --> 03:17:09.900
the department of that employee so I'm sorry

03:17:11.280 --> 03:17:12.880
Next one

03:17:13.640 --> 03:17:19.960
So don't forget to set server put on server output on then exec

03:17:19.960 --> 03:17:28.800
Show employee details then what is the parameter so the expected output will be employee name Jando then department is IT

03:17:29.980 --> 03:17:30.860
then

03:17:31.520 --> 03:17:33.560
How about working with?

03:17:34.140 --> 03:17:35.560
multiple out

03:17:35.560 --> 03:17:39.960
parameters so in this case we have two out parameters

03:17:39.960 --> 03:17:45.240
So we begin with select first name last name salary in two

03:17:46.480 --> 03:17:53.240
EMP name and salary so from employees or employee IDs EMP underscore ID

03:17:53.240 --> 03:17:59.240
So execution and SQL plus so variable name, so we define variable name

03:18:00.080 --> 03:18:04.060
bar chart variable salary number then we exec

03:18:04.060 --> 03:18:07.480
or execute get employee info

03:18:07.480 --> 03:18:09.280
by the input

03:18:10.080 --> 03:18:13.080
Then we expect like this, so we print the name

03:18:13.660 --> 03:18:15.160
then the salary

03:18:15.160 --> 03:18:19.000
So name will be Jando salary is 60,000

03:18:20.080 --> 03:18:27.060
So how about for in out parameters in action so like this we create update bonus

03:18:27.060 --> 03:18:30.200
So the process will be EMP bonus plus

03:18:31.500 --> 03:18:35.080
500 so in in out parameter

03:18:36.240 --> 03:18:38.440
The EMP bonus is

03:18:39.440 --> 03:18:46.040
It's both input and output the initial value of EMP bonus is passed to the procedure

03:18:46.560 --> 03:18:48.600
modified and returned

03:18:48.600 --> 03:18:55.140
Okay, so the logic the procedure incrementing the current bonus by 500 for the

03:18:55.800 --> 03:19:02.080
specified employee ID so you in and out by the show my default kuneari may bonus tapas

03:19:02.900 --> 03:19:05.620
Magbabago ng bonus for example maibang parameter

03:19:06.500 --> 03:19:07.300
so

03:19:07.300 --> 03:19:12.580
pag nag lagi ka ng in and out so it can accept value

03:19:12.580 --> 03:19:18.940
default or any value then it expect to out a

03:19:18.940 --> 03:19:23.440
New value or siya parin ko wala niyong binago dun sa process

03:19:24.580 --> 03:19:29.860
So it's like the bind variable for the in and out parameter

03:19:29.860 --> 03:19:37.620
So first we assign the initial value for example bonus nya 1000 then we call the procedure

03:19:38.780 --> 03:19:40.780
expect update bonus

03:19:41.380 --> 03:19:44.380
101 bonus then we print it like this

03:19:46.040 --> 03:19:51.660
So like declare time initially tapos tinawag natin update bonus

03:19:52.400 --> 03:19:54.900
ni 101

03:19:56.120 --> 03:19:59.840
Tapos print natin siya remember naglagay tayo dito ng

03:20:00.660 --> 03:20:05.740
Ano yung process nya whatever the bonus na iya plus 500

03:20:06.600 --> 03:20:09.140
kaya pagdating dito

03:20:09.140 --> 03:20:11.300
so si 101 na ID

03:20:12.540 --> 03:20:14.740
so 500 yung

03:20:15.540 --> 03:20:23.600
1000 for example ito in hardcode lang natin kaya naging 1500 then we create or replace debug demo

03:20:23.600 --> 03:20:25.460
so step one we

03:20:26.780 --> 03:20:28.900
The procedure started

03:20:28.900 --> 03:20:31.000
Then exception

03:20:31.000 --> 03:20:38.440
So error data no pound so ito yung pag kumbaga we can use the dbms output for debugging

03:20:38.440 --> 03:20:44.020
Para makita natin yung step nasa na ba tayo especially if you're working with the current code

03:20:44.820 --> 03:20:50.580
You can you can debug it de ba parang you cannot eat the big elephant

03:20:50.580 --> 03:20:57.020
But if you chunk it de ba makakain mo rin siya parang ganun so using using the

03:21:00.380 --> 03:21:02.460
Debugging putting output

03:21:04.500 --> 03:21:06.900
Outputing the the text

03:21:07.940 --> 03:21:09.460
Yung result

03:21:10.060 --> 03:21:17.940
Mas madali mo siyang madi debug then the execution and SQL plus so we set server output on then just type

03:21:17.940 --> 03:21:19.940
exact then the

03:21:19.940 --> 03:21:21.820
procedure name so here

03:21:22.360 --> 03:21:27.700
Based in sa una nating slide so ito yung output step one procedure started

03:21:27.700 --> 03:21:31.420
Tapos kong error no data found

03:21:34.900 --> 03:21:40.700
Tapos structure naman pag out parameter yung procedure so param one in

03:21:41.240 --> 03:21:45.460
ito lang tatandaan yung out na data type meaning it expect to

03:21:46.520 --> 03:21:53.540
To return or to have new value logic to calculate or retrieve values from param two

03:21:56.480 --> 03:21:56.660
So

03:21:59.140 --> 03:22:03.980
This is the sample of creating a procedure with an out parameter

03:22:04.580 --> 03:22:07.340
So we create a procedure

03:22:07.340 --> 03:22:10.740
So we have been input number in then output

03:22:11.340 --> 03:22:15.580
Square as out number then we just multiply the input

03:22:16.780 --> 03:22:18.860
the same input number and

03:22:20.780 --> 03:22:21.380
Then

03:22:21.380 --> 03:22:27.780
That that will be the output square, so if we call it in the procedure in SQL plus

03:22:29.100 --> 03:22:35.940
So we define the variable as square result number then we execute calculate square 5

03:22:37.520 --> 03:22:42.700
Then the square result kamagadito natin lalag yung square result don't forget to

03:22:43.400 --> 03:22:50.680
To define it then we can print that so since 5 siya 5 times 5 25 ka 25 yung result

03:22:51.380 --> 03:22:55.280
So if we put 6 it will be 6 times 6 36

03:22:58.560 --> 03:23:04.400
So how about we by the way mag break tayo ng 3 p.m..

03:23:04.400 --> 03:23:07.260
So let's finish the entire up to trigger

03:23:07.780 --> 03:23:14.980
So we create or replace procedure so for example in this case. We have to as we discussed before

03:23:16.040 --> 03:23:21.360
EMP name and the out the multiple out so we call the

03:23:21.380 --> 03:23:24.460
procedure to

03:23:24.460 --> 03:23:26.600
We will call the procedure in a bit

03:23:26.600 --> 03:23:33.620
So here we select it and to call the procedure we accept get employee details sino yung 101

03:23:34.700 --> 03:23:39.420
tapos kanino siya ililipat say EMP named and EMP salary

03:23:39.420 --> 03:23:44.460
So if we print that it will just print EMP name then

03:23:45.260 --> 03:23:46.460
EMP salary

03:23:46.460 --> 03:23:54.300
Then we declare the result number calculate 6 result yung kanina yung square

03:23:54.860 --> 03:23:57.260
Diba so yung pag 6

03:23:58.260 --> 03:24:03.220
Since it's multiple the function here multiply it so it will be 36

03:24:09.200 --> 03:24:14.440
Then this is the syntax for create or replace procedure name

03:24:15.240 --> 03:24:15.880
So

03:24:15.880 --> 03:24:24.120
Output parameters are used in a store procedure to return values to calling the program this parameter is specified with the keyword out

03:24:24.880 --> 03:24:31.880
In the procedure definition so when the procedure is called the value assigned to the out parameter inside the procedure

03:24:31.880 --> 03:24:35.380
It's available to the caller after the execution

03:24:36.560 --> 03:24:38.920
So we will have a sample later on

03:24:41.040 --> 03:24:42.720
So one moment

03:24:43.560 --> 03:24:45.960
So here we call the procedure

03:24:46.900 --> 03:24:51.560
So get employee name so the result will be employee name jando

03:24:54.240 --> 03:25:00.900
Then this is the syntax for creating a function so parameter name name of the input parameters

03:25:00.900 --> 03:25:06.240
Then the return data type so we have to specify the data type the value

03:25:06.760 --> 03:25:12.220
The function will return then the return use inside the function body to return a value

03:25:13.340 --> 03:25:14.100
so

03:25:14.100 --> 03:25:18.120
We already create a function in a while ago

03:25:18.120 --> 03:25:22.260
Then we can simply have a return

03:25:22.960 --> 03:25:30.600
Have a return function here, so you just multiply by 12 the monthly salary, so we use the function so we declare

03:25:32.680 --> 03:25:37.500
5000 then we prepare the annual salary

03:25:38.240 --> 03:25:40.460
Then we begin annual salary

03:25:40.460 --> 03:25:44.860
Colon equal so was we assign the function of get annual salary

03:25:46.340 --> 03:25:47.020
so

03:25:47.020 --> 03:25:50.460
5000 will be multiplied by 12,000

03:25:51.040 --> 03:25:54.680
That's why when we output the annual salary it will be 60,000

03:25:54.680 --> 03:25:59.280
So again the key points of that is its returns of value

03:25:59.280 --> 03:26:04.140
The function the reusability because you can use it

03:26:05.840 --> 03:26:11.300
However, you like then calling in SQL so function can be both

03:26:11.300 --> 03:26:15.420
invoke in SQL queries if they are

03:26:15.420 --> 03:26:19.380
Deterministic meaning it always return the same result for the same input

03:26:20.200 --> 03:26:22.380
So my advice is do not perform

03:26:24.720 --> 03:26:26.160
DML or

03:26:26.160 --> 03:26:30.460
The operation like insert update delete in the function, okay?

03:26:31.160 --> 03:26:33.240
Then make it sure you add

03:26:33.240 --> 03:26:35.280
exception handling to

03:26:36.820 --> 03:26:39.200
To catch all the errors and

03:26:40.600 --> 03:26:46.200
Avoid resource intensive operation in the function used within SQL queries to prevent

03:26:46.200 --> 03:26:50.960
Performance issues especially when processing large data set

03:26:51.680 --> 03:26:53.680
so here let's

03:26:55.440 --> 03:26:58.040
This function calculate the bonus

03:26:59.120 --> 03:27:06.340
So here we we want to calculate the bonus for an employee based on the salary in performance

03:27:06.340 --> 03:27:13.280
So the business rules if the performance rating is 5 the bonus is 20% of the salary

03:27:13.880 --> 03:27:18.360
So here if the p rating performance bonus is 5

03:27:19.640 --> 03:27:26.560
So let's put the bonus the salary times 0.20 or 20%

03:27:26.560 --> 03:27:31.500
If the rating is 4, salary nya is 10%

03:27:31.500 --> 03:27:32.280
Else

03:27:32.280 --> 03:27:37.720
Kung magandis siya nag-qualified sa dalawang criteria, maybe the rating is 3 to 1

03:27:38.500 --> 03:27:40.680
Then the bonus will be

03:27:40.680 --> 03:27:42.560
salary times 5%

03:27:44.460 --> 03:27:48.960
So that's how you create a function this is the employee

03:27:50.600 --> 03:27:56.180
So using the function npl SQL block so ganun na natin siya gagamitin

03:27:56.560 --> 03:28:04.740
So calculate bonus salary we declare salary here then rating okay tapos magigamit na yung function

03:28:05.840 --> 03:28:08.960
So here we expect the bonus is 10,000

03:28:10.060 --> 03:28:13.620
So here using the function in SQL query

03:28:13.620 --> 03:28:20.080
So pwede rin natin siya gamitin sa select. So kanyari select employee salary calculate bonus

03:28:20.600 --> 03:28:24.560
yun salary comma performance as bonus

03:28:25.320 --> 03:28:26.760
From employees

03:28:28.700 --> 03:28:29.420
so

03:28:29.420 --> 03:28:31.440
May kita na natin yung

03:28:31.440 --> 03:28:33.840
kumaga ito yung magiging yung result nya

03:28:34.660 --> 03:28:36.680
Using using that function

03:28:36.680 --> 03:28:39.760
So we can use function in the select as well

03:28:40.760 --> 03:28:45.500
So again handling error and showing errors, so we add exception

03:28:46.080 --> 03:28:50.640
Tapos ito yung mga common system define exception like no data found, too many rows

03:28:50.880 --> 03:28:58.600
Zero divide invalid number and others so others catches all the others exception that are not explicitly handled

03:28:59.460 --> 03:29:02.820
So it best practices to always have exception

03:29:02.820 --> 03:29:07.760
So you have something to refer to if error arise

03:29:10.000 --> 03:29:13.760
Then is example of displaying the error so

03:29:15.180 --> 03:29:21.920
Like this one so when zero divide we say DBMS put line division zero is not allowed

03:29:22.660 --> 03:29:26.400
Since especially weren't when you're using division, okay

03:29:28.100 --> 03:29:28.920
So

03:29:28.920 --> 03:29:31.800
always use exception then we

03:29:31.800 --> 03:29:36.240
Using SQL SQL ERM, which is a built-in

03:29:36.240 --> 03:29:40.580
Function in PL SQL. So it provides their message

03:29:40.580 --> 03:29:44.120
Associated with the most recently raised exceptions

03:29:44.820 --> 03:29:48.500
Here's your handle that so we'll again understand when others

03:29:49.560 --> 03:29:52.740
So we should show you your error message

03:29:52.740 --> 03:29:57.740
If you want to show error code you say you put SQL

03:29:59.260 --> 03:29:59.980
Code

03:30:01.980 --> 03:30:05.780
Here the example of handling multiple exception

03:30:08.060 --> 03:30:10.040
Think it's done

03:30:10.040 --> 03:30:15.100
This is the custom error handling. So the bar we can we can have

03:30:16.260 --> 03:30:21.560
Our own custom error handling. So here

03:30:21.560 --> 03:30:26.440
Don't forget to declare invalid operation as exception

03:30:27.180 --> 03:30:28.640
Okay

03:30:28.640 --> 03:30:29.400
Baka

03:30:29.400 --> 03:30:36.800
The miracle is a begin so be sure na but declare new Muna as exception you variable now

03:30:36.800 --> 03:30:38.280
so pag narration

03:30:39.300 --> 03:30:41.340
Variable now as exception

03:30:41.340 --> 03:30:42.080
narration

03:30:43.500 --> 03:30:45.980
Meaning depends on logic

03:30:45.980 --> 03:30:52.000
You know what with the exception? So he released exception and then it will fire whatever the

03:30:53.860 --> 03:30:58.920
Logic you want to do like if you want to roll back or if you want to log in the database

03:30:59.900 --> 03:31:02.120
So you can do it you can do it

03:31:03.200 --> 03:31:05.480
So again key function

03:31:05.480 --> 03:31:12.080
So SQL code returns the numeric code of the last exception then the SQL SQL ERM

03:31:13.020 --> 03:31:17.320
Returns the human readable error message associated with the exception

03:31:17.940 --> 03:31:20.000
because the error code of

03:31:20.960 --> 03:31:29.880
Oracle is your or a does zero one four seven six, which is not relevant to the user if we're gonna show it

03:31:29.880 --> 03:31:34.960
then describe function names, so if we want to check or

03:31:35.800 --> 03:31:37.680
if we have a lot of

03:31:38.220 --> 03:31:40.560
Function we can

03:31:40.560 --> 03:31:42.360
type describe to see

03:31:43.100 --> 03:31:48.180
What are the what is that function? What did this do and the source code?

03:31:48.180 --> 03:31:54.780
For example in this instance, we sorry for example in this instance. We type describe calculate total price

03:31:54.780 --> 03:31:59.100
So the function will be total price and it will return a table time

03:32:00.060 --> 03:32:01.940
Ano yung mga

03:32:01.940 --> 03:32:05.940
Argument name so p-price and in data type number

03:32:05.940 --> 03:32:08.740
tapas if it is in out or in out

03:32:10.460 --> 03:32:11.100
so

03:32:11.660 --> 03:32:16.480
This is the example of calling the function in PLS SQL block

03:32:17.340 --> 03:32:23.320
So the output will be total price 110 then in SQL query calculate total price

03:32:25.220 --> 03:32:32.480
So when to use the describe so to understand the structure of a function before using it in your code

03:32:32.480 --> 03:32:35.000
You know to verify the types of

03:32:36.320 --> 03:32:36.880
modes

03:32:37.860 --> 03:32:43.720
so because it means and they have the function parent in and out but or in out

03:32:44.590 --> 03:32:50.890
So describe command is available in SQL plus and SQL developer in similar tools

03:32:50.890 --> 03:32:57.990
So the limitation of describe commands does not show function internal logic view the code use

03:32:57.990 --> 03:32:58.730
so

03:33:01.810 --> 03:33:02.610
Tapos

03:33:05.790 --> 03:33:09.910
To inspect the internal logic of a function use the following query

03:33:10.730 --> 03:33:14.610
You at all select text from all source or name

03:33:15.290 --> 03:33:16.490
Ano yung

03:33:16.490 --> 03:33:20.830
Function name and and koning type nyakon function procedure

03:33:20.830 --> 03:33:27.530
It will show you the source code. I think we can we can try this one. Can you try this one in your end?

03:33:30.070 --> 03:33:33.510
I think we have already have calculated calculate total price

03:33:33.510 --> 03:33:37.470
Can you try on your end to see if the source code will appear?

03:33:50.130 --> 03:33:51.510
I

03:33:52.970 --> 03:33:58.510
Yeah, I think but in size scale developer, yes

03:34:10.590 --> 03:34:11.990
You

03:34:53.570 --> 03:34:54.970
You

03:35:28.250 --> 03:35:34.470
Well, I'm a little bit serious or Jerry, but I may function kapo bang ganun calculate total price

03:35:39.250 --> 03:35:41.390
Give up go down

03:35:41.910 --> 03:35:48.090
Oops, stop and functions calculate bonus. Try mo nalang pin calculate bonus. You know, okay

03:35:48.630 --> 03:35:50.250
So make it a natin yung code

03:35:53.730 --> 03:35:54.410
So

03:35:57.090 --> 03:35:57.770
I

03:35:57.770 --> 03:36:03.630
Feel feel SQL function are versatile and can be invoked in various contexts below is the breakdown

03:36:03.630 --> 03:36:10.770
Where how function can be called using the calculate area which we done a while ago

03:36:13.310 --> 03:36:14.670
Then I

03:36:14.670 --> 03:36:21.070
Think now it is your calling fields SQL. So at the moment yung nested function call

03:36:21.070 --> 03:36:26.450
So nested function call in PLS will allow one function

03:36:26.450 --> 03:36:32.470
To invoke another to build more complex logic below is an example where a double area

03:36:34.310 --> 03:36:40.810
Function called a calculate area. So salob ng function may tinaugpas ang function

03:36:41.350 --> 03:36:45.450
Okay to compute and return, you know double area

03:36:45.450 --> 03:36:51.050
So here we have input parameters length and width are passed to the double area

03:36:51.070 --> 03:36:56.430
Then the nested function double area calls the calculate

03:36:56.430 --> 03:36:59.930
Underscore area function to compute the area

03:36:59.930 --> 03:37:05.910
So there the result from calculate area is stored in the local variable L

03:37:06.910 --> 03:37:08.570
underscore area

03:37:08.570 --> 03:37:10.790
so double area returns L

03:37:11.990 --> 03:37:17.390
Underscore area times 2 or multiply by 2 which is double the calculated area

03:37:19.710 --> 03:37:19.990
So

03:37:20.610 --> 03:37:25.450
So just first ensure that the calculate area function is already created

03:37:25.450 --> 03:37:31.070
Then create the double error function when you get a try it

03:37:31.070 --> 03:37:32.990
Okay, but it's simply

03:37:32.990 --> 03:37:36.590
After calculating the area just multiply by 2

03:37:37.590 --> 03:37:41.210
So here's here's will be the example

03:37:42.250 --> 03:37:51.010
So then remember in the in the calculate area we just multiply it so 10 times 5 is 50 then

03:37:51.750 --> 03:37:56.490
The double will do multiply by 2 times 2 so that is 100

03:37:58.810 --> 03:37:59.630
So

03:37:59.630 --> 03:38:01.230
We can also

03:38:01.230 --> 03:38:03.510
Function with default parameters

03:38:03.510 --> 03:38:09.150
So in this case the tax rate the default of that is 10

03:38:09.150 --> 03:38:16.590
So pwede tayo mag-assign ng default value dun sa tax rate in this case in the calculate tax

03:38:19.250 --> 03:38:22.550
So mandatory versus optional parameters, so

03:38:23.610 --> 03:38:27.310
P amount is mandatory. So it's a no default value

03:38:27.970 --> 03:38:30.030
While P tax rate is optional

03:38:30.730 --> 03:38:35.870
So kong walang nilagay na tax rate, so may default na kasi siya na 10

03:38:35.870 --> 03:38:40.950
So the flexibility and function called the function can be called with or without

03:38:42.490 --> 03:38:48.990
Specifying the tax rate kasi may default value na siya, but the amount should have value

03:38:50.130 --> 03:38:51.650
The P amount

03:38:52.190 --> 03:38:57.850
So ing nga pag yung tax rate walang pre-novate na data

03:38:58.710 --> 03:39:04.910
It will use the default 10, but if you pass explicitly for example 15 or 20

03:39:04.910 --> 03:39:08.150
The function use that value instead of the default

03:39:08.150 --> 03:39:11.310
So in this case, we calculate the tax

03:39:12.230 --> 03:39:14.410
1000 comma 12

03:39:14.410 --> 03:39:21.910
So the tax will be 120 then here we didn't pass the 12 so it will

03:39:23.330 --> 03:39:24.890
Default to 10

03:39:24.890 --> 03:39:27.350
So the answer will be 100

03:39:28.570 --> 03:39:35.750
So calling function in select statement which aggregate function can be combined with aggregate function in SQL queries

03:39:37.090 --> 03:39:43.650
Example using a function with aggregates is select some calculate area length with a

03:39:43.650 --> 03:39:48.290
Total area so best practices is use appropriate context

03:39:48.950 --> 03:39:51.050
Okay, then

03:39:52.430 --> 03:39:53.310
Use

03:39:54.270 --> 03:39:59.790
Validate the parameters and avoid overuse in queries

03:40:01.110 --> 03:40:05.850
So this appropriate context yung function should perform lightweight

03:40:06.530 --> 03:40:11.950
Determinants of calculation in SQL queries to avoid performance bottlenecks

03:40:12.990 --> 03:40:16.990
Use for simple calculation like area tax or discount

03:40:16.990 --> 03:40:20.990
Then validate the parameter ensure that the function others

03:40:21.790 --> 03:40:25.890
Invalid or null input gracefully to prevent run times error

03:40:26.810 --> 03:40:35.070
So we can do you can do if p-length is null or p-width is null then return zero to handle missing values

03:40:35.070 --> 03:40:39.470
Then when I say avoid overuse queries, it's using complex or non

03:40:40.550 --> 03:40:45.850
Deterministic function in SQL queries, you know that can degrade performance

03:40:46.470 --> 03:40:48.470
Especially with large data set

03:40:49.370 --> 03:40:51.610
Um, yeah

03:40:53.830 --> 03:40:56.770
So, I think let's have a break let's

03:40:57.930 --> 03:41:00.770
Resume by 320 is that okay?

03:41:04.030 --> 03:41:06.090
320 p.m. Okay

03:41:50.090 --> 03:41:51.210
Okay

03:42:00.170 --> 03:42:02.350
Ako daw magbabag kasi hindi

03:42:02.350 --> 03:42:05.390
Hindi magbabag

03:42:07.170 --> 03:42:09.330
Pero ano tayo?

03:42:10.250 --> 03:42:11.110
Sa coffee shop

03:42:18.770 --> 03:42:18.810
I

03:42:38.370 --> 03:42:39.830
Boss asan si George

03:42:44.310 --> 03:42:45.250
Asan si George

03:42:48.810 --> 03:42:50.950
Nasapan chon agad ba

03:42:58.670 --> 03:42:59.750
Okay

03:43:48.770 --> 03:43:51.390
Asan si nasapan chon, hindi na namin kung parang gagawin.

03:43:51.550 --> 03:43:53.530
Oh sige update update mo ako pre ha

03:43:53.530 --> 03:43:55.450
Oh sige na sige na talaga talaga

03:43:55.450 --> 03:44:00.530
Thank you pre

03:44:04.170 --> 03:44:07.750
Tingin mo bang yung pintumating mo yung darilangin pag magsasala?

03:44:10.770 --> 03:44:11.270
Weh?

03:44:11.450 --> 03:44:12.070
Kasap ko ba?

03:44:12.790 --> 03:44:13.290
Ah!

03:44:13.670 --> 03:44:15.330
Diyo wala na yung family, ma'am

03:44:15.330 --> 03:44:17.170
Suspital ko siya namatay?

03:44:18.330 --> 03:44:19.110
Kasap ko tayo?

03:44:19.730 --> 03:44:20.910
Kasap paano ulit?

03:44:20.970 --> 03:44:21.350
Paano na?

03:44:21.390 --> 03:44:23.650
Yung family may ano na ako ngayon

03:44:23.650 --> 03:44:24.170
Ano na naman?

03:44:24.190 --> 03:44:24.630
Ano na naman?

03:44:25.010 --> 03:44:27.050
Ano mong mahal ba akong magkain man?

03:44:27.690 --> 03:44:28.930
Salita ko ni George

03:44:28.930 --> 03:44:30.590
Hindi parang man na naman

03:44:31.330 --> 03:44:32.690
Sige namin ni Becca

03:44:33.410 --> 03:44:34.290
Hindi na ba?

03:44:34.290 --> 03:44:35.770
Hindi naman ko na Becca eh

03:44:36.390 --> 03:44:37.410
Mula na tayo ngayon na?

03:44:38.110 --> 03:44:40.110
Hindi baka mababigyan eh

03:44:40.110 --> 03:44:40.850
Okay

03:44:40.850 --> 03:44:42.190
As well

03:44:43.470 --> 03:44:43.990
Hindi

03:44:44.810 --> 03:44:46.070
Less na to, less na to

03:44:46.070 --> 03:44:47.670
I mean yes

03:44:51.570 --> 03:44:53.430
Hindi ang ingi pa nyan?

03:44:54.050 --> 03:44:55.670
Hindi naman, ikaw lang maingay

03:44:55.670 --> 03:44:56.630
Hindi ako maingay na

03:44:56.630 --> 03:44:58.850
Naman dito siya hindi siya maingay ko

03:44:58.850 --> 03:45:00.250
Parang maingay ako

03:45:00.250 --> 03:45:02.070
Manood ka si Tutor

03:45:02.070 --> 03:45:03.950
Anong turo?

03:45:04.890 --> 03:45:05.530
Ayano

03:45:06.570 --> 03:45:07.210
SQL

03:45:07.210 --> 03:45:08.990
Kala po ano

03:45:08.990 --> 03:45:11.270
Ikaw yung natuturaan

03:45:11.270 --> 03:45:12.850
No, I'm the one who's teaching

03:45:16.070 --> 03:45:18.430
I'm not teaching you business

03:45:20.130 --> 03:45:20.470
No

03:45:21.130 --> 03:45:21.990
database

03:45:21.990 --> 03:45:23.210
SQL

03:45:25.470 --> 03:45:28.050
Paano ba siya yung natutura?

03:45:28.770 --> 03:45:29.910
Kasi kadaan

03:45:31.430 --> 03:45:33.310
Ikaw na kung anong do

03:45:33.310 --> 03:45:34.730
Sige atin

03:45:34.730 --> 03:45:36.030
Kita dyan?

03:45:36.810 --> 03:45:37.810
Oo

03:45:37.810 --> 03:45:38.710
Yung slide

03:45:39.470 --> 03:45:40.410
Bailangan mo naman?

03:45:41.470 --> 03:45:42.470
Yes

03:45:42.470 --> 03:45:45.870
Ikaw mababalan ka?

03:45:45.870 --> 03:45:46.870
Yes

03:45:46.870 --> 03:45:48.490
Pagtimuro ka?

03:45:48.570 --> 03:45:49.150
Yes

03:45:49.150 --> 03:45:49.670
Pa?

03:45:50.390 --> 03:45:51.350
Magkana ko ha?

03:45:51.850 --> 03:45:52.470
Sige eh

03:45:53.330 --> 03:45:55.590
Baka pabalik ka marami eh

03:45:55.590 --> 03:45:57.490
Baka mabalik ka eh

03:45:57.490 --> 03:45:59.270
Pagbaka natin sa post pa

03:46:03.430 --> 03:46:05.770
Hindi ka naman matan sa drums?

03:46:07.150 --> 03:46:07.170
Oo

03:46:07.170 --> 03:46:08.730
Wala akong drums

03:46:08.730 --> 03:46:09.450
Bakit?

03:46:10.370 --> 03:46:10.830
Pwede pa?

03:46:12.450 --> 03:46:13.130
Sige

03:46:15.530 --> 03:46:17.710
52 minutes na?

03:46:19.310 --> 03:46:19.890
Pwede pwede 10 nalang

03:46:19.890 --> 03:46:22.770
Hindi kanyang naman, nakikita ngayon

03:46:22.770 --> 03:46:24.630
Kanyang napakalim na hindi yung nagkaroon

03:46:25.230 --> 03:46:25.430
Magkakawa

03:46:26.390 --> 03:46:29.050
Bwede hindi sabihin siya sa awa sa'yo

03:46:29.050 --> 03:46:30.930
Wala sabihin magkakawa

03:46:30.930 --> 03:46:32.310
Kasi hindi naman magkakawa

03:46:33.230 --> 03:46:34.350
Oksan? Salid?

03:46:34.930 --> 03:46:35.530
Ano na?

03:46:36.490 --> 03:46:37.570
Sige eh

03:46:38.170 --> 03:46:38.250
Sige

03:46:39.270 --> 03:46:39.910
Sorry

03:46:39.910 --> 03:46:41.250
As marami

03:46:41.250 --> 03:46:43.050
Forgive this

03:46:43.050 --> 03:46:43.890
Ay

03:46:43.890 --> 03:46:44.190
Ayan naman siya

03:46:46.470 --> 03:46:47.110
Malik

03:46:47.110 --> 03:46:48.170
Muglasa ni

03:46:54.110 --> 03:46:55.810
Salaya naman sasitin yung drum

03:46:59.170 --> 03:47:00.210
Uy bwag na out na

03:47:00.210 --> 03:47:02.170
Bwag isa na kami bwag na

03:47:02.810 --> 03:47:03.390
Ayun na

03:47:03.390 --> 03:47:04.110
Bwag na bwag na

03:47:04.110 --> 03:47:05.030
Bawal na maingay

03:47:05.030 --> 03:47:06.610
Yung door naman ayusin ninyo naman

03:47:06.610 --> 03:47:07.530
Bapag maiwan!

03:47:08.070 --> 03:47:09.610
Alalain nyo sa ngayon!

03:47:13.670 --> 03:47:14.910
Bapag maingay bam!

03:47:15.610 --> 03:47:18.090
Okay great, so let's continue.

03:47:22.910 --> 03:47:27.970
So again, I'm just showing a sample calling a function,

03:47:28.830 --> 03:47:33.210
but you have the base knowledge on how to create a function.

03:47:34.150 --> 03:47:35.910
In and out ng process.

03:47:35.910 --> 03:47:37.910
In and out procedure.

03:47:42.390 --> 03:47:47.610
So calling the function in anonymous PLS SQL block.

03:47:48.750 --> 03:47:55.750
So here we verify that the calculate tags function is created with the following definition.

03:47:58.650 --> 03:48:01.890
Be sure to set server output on.

03:48:02.890 --> 03:48:05.750
Then we can run the anonymous block.

03:48:07.250 --> 03:48:08.890
So in this case...

03:48:11.630 --> 03:48:16.390
So first is we declare tags amount as number.

03:48:17.130 --> 03:48:22.190
Then we begin to call the calculate tags function.

03:48:23.270 --> 03:48:29.050
So we put the P amount 1000 then the tags rate 12.

03:48:29.050 --> 03:48:37.510
Then we ensure that the function exists, the calculate tags is created.

03:48:39.150 --> 03:48:42.310
Then we can run that.

03:48:43.870 --> 03:48:53.490
So anonymous PLS SQL blocks provide a quick and flexible way to test and utilize function like calculate tags,

03:48:53.750 --> 03:48:57.370
making them invaluable for ad hoc computing and debugging.

03:48:59.050 --> 03:49:00.930
You can learn more about that.

03:49:01.190 --> 03:49:04.550
So calling function with parameter and SQL+.

03:49:04.550 --> 03:49:08.990
So when I say SQL+, it is running on the terminal.

03:49:10.890 --> 03:49:14.510
So here we define the variable P amount, tags rate be solved.

03:49:14.670 --> 03:49:19.650
Then we begin, we initialize or assign values to amount and tags rate.

03:49:20.330 --> 03:49:22.010
Then we calculate the tags rate.

03:49:22.150 --> 03:49:24.070
The result will be 150.

03:49:25.290 --> 03:49:27.050
So that is the tags.

03:49:29.690 --> 03:49:33.050
For calling the function in SELECT with aggregates.

03:49:34.270 --> 03:49:39.050
So here we call the calculate tags on the SELECT.

03:49:42.410 --> 03:49:45.050
So we calculate the tags after calculating the tags.

03:49:46.310 --> 03:49:50.750
So the order amount, let's imagine that it is in the total tags.

03:49:51.690 --> 03:49:55.470
So we calculate the tags then we assign it from orders.

03:49:56.470 --> 03:49:56.910
Okay.

03:49:58.210 --> 03:50:06.010
So we can see what is included in the calculate tags if we use describe.

03:50:08.350 --> 03:50:12.490
So best practices for using function in SQL+.

03:50:12.490 --> 03:50:15.350
So enable the server output.

03:50:16.130 --> 03:50:20.670
Use the dual table for calling function without a specific table.

03:50:21.310 --> 03:50:23.950
Debug with DMS output line.

03:50:23.950 --> 03:50:27.270
Then leverage SQL plus variable.

03:50:27.730 --> 03:50:32.230
So pass parameter dynamically using SQL plus variable print.

03:50:35.110 --> 03:50:45.870
So the dual table is a single row or single column table provided by Oracle for evaluating expressions and calling function without needing a table.

03:50:48.990 --> 03:50:53.170
So example, benefits of modular programming.

03:50:53.170 --> 03:50:55.350
First is reusability.

03:50:55.510 --> 03:50:58.470
Code can be reused in multiple programs or script.

03:50:59.250 --> 03:51:04.390
Maintainability, it's easier to debug and update specific parts of the application.

03:51:04.950 --> 03:51:10.390
Readability, smaller modules make the codes easier read and understand.

03:51:10.870 --> 03:51:17.510
Scalability, modular design facilitate adding new function without major changes.

03:51:17.510 --> 03:51:25.510
Then encapsulation, packages allow hiding implementation details while exposing only necessary parts.

03:51:30.710 --> 03:51:34.490
So here's the example of modular programming in SQL.

03:51:35.670 --> 03:51:38.510
So like here we create replace procedure update salary.

03:51:41.490 --> 03:51:46.930
So the procedure encapsulate a series of statement to perform a specific task.

03:51:46.930 --> 03:51:52.390
They are commonly used for data manipulation and business logic implementation.

03:51:53.450 --> 03:51:58.570
So for example, in this case, our procedure is to update the employer salary.

03:51:58.630 --> 03:52:01.930
So we call the procedure.

03:52:02.890 --> 03:52:06.670
So for example, we begin to update salary.

03:52:09.790 --> 03:52:17.550
So here we take the employee ID that identifies the employee whose salary is to be updated.

03:52:18.550 --> 03:52:21.890
Then the new salary specify the new salary.

03:52:22.670 --> 03:52:26.010
Then the update statement modifies the salary column.

03:52:26.690 --> 03:52:28.830
So we set the salary with the new salary.

03:52:29.330 --> 03:52:31.590
Same here with the calculate bonus.

03:52:31.590 --> 03:52:33.390
So packages.

03:52:33.930 --> 03:52:39.210
So packages will be learned at the end of the module.

03:52:39.610 --> 03:52:46.750
But let's have a quick overview that the package is a collection of related procedure, function, variables, and cursor.

03:52:48.150 --> 03:52:56.230
It's also a modular unit in PLSQL that groups logically related like procedure, function, variables, and cursor.

03:52:57.230 --> 03:53:08.750
So the components of package, it's declare the public interface, specify which element, procedure, function, or variables are accessible outside the package.

03:53:09.450 --> 03:53:15.450
The package body contains the implementation details of the elements declared in the specification.

03:53:16.370 --> 03:53:21.630
It can also include private elements that are not accessible outside the package.

03:53:22.730 --> 03:53:26.910
So example of package is the employee management.

03:53:28.290 --> 03:53:33.530
So here, this is the basic index, create or replace package, employee package.

03:53:34.130 --> 03:53:46.970
So the procedure is mag-add siya ng employee, then function, get salary, we declare employee ID, then return the number, then that's the employee package.

03:53:46.970 --> 03:53:54.550
It's like we're wrapping all the procedure and function in one package to have another logic.

03:53:55.890 --> 03:54:00.370
So I will give example and we will have exercise, I think, by tomorrow.

03:54:01.950 --> 03:54:05.770
So this is the example of creating a package body.

03:54:06.130 --> 03:54:08.170
So procedures, so we add an employee.

03:54:09.130 --> 03:54:11.890
So begin, insert into employee.

03:54:12.350 --> 03:54:15.790
Then we have another function here, get salary.

03:54:15.790 --> 03:54:24.050
Pay employee ID, then we return it, return number, so salary number.

03:54:24.750 --> 03:54:30.150
Then here we select the salary into salary from employees where employee ID is employee ID.

03:54:31.130 --> 03:54:31.830
Then return.

03:54:32.570 --> 03:54:41.110
So we can call that using this employee package, this one employee package, that add employee.

03:54:41.110 --> 03:54:46.270
So here we use the function or procedure, add employee.

03:54:47.110 --> 03:54:52.930
And we take the parameter's name, Jando, and the salary is 60,000.

03:54:53.830 --> 03:55:01.130
So the output will be salary, then the employee, for example, get salary.

03:55:01.230 --> 03:55:04.450
So this is the function of 101.

03:55:07.650 --> 03:55:10.490
So trigger, I think I have that in trigger.

03:55:10.490 --> 03:55:17.930
So triggers are automatically executed in PLSQL blocks that run when a specified event occurs in the database.

03:55:18.850 --> 03:55:21.590
Triggers add automation to modular programming.

03:55:23.130 --> 03:55:25.610
Let's try to use the trigger.

03:55:25.790 --> 03:55:31.910
I prepared one example in slides 298.

03:55:32.170 --> 03:55:33.510
Can we try that?

03:55:34.570 --> 03:55:38.950
So first we have to create a function, isHighEarner.

03:55:38.950 --> 03:55:41.990
Then we create or replace a trigger.

03:55:42.690 --> 03:55:46.590
Then we prepare a test case that we can use.

03:55:47.150 --> 03:55:48.650
Can you try it please?

03:55:50.230 --> 03:55:51.830
Slides 298.

03:55:57.490 --> 03:56:02.490
So first you create a function, isHighEarner.

03:56:03.770 --> 03:56:04.950
Nasababa din siya.

03:56:05.830 --> 03:56:07.770
Tapos we can create trigger.

03:56:09.470 --> 03:56:11.670
Tapos pwede na natin siyang i-test.

03:56:11.890 --> 03:56:13.670
Pwede tayo mag-insert ng employee.

03:56:15.050 --> 03:56:15.850
And we can update.

03:56:16.030 --> 03:56:17.870
Dapat ma-trigger natin.

03:56:17.930 --> 03:56:21.950
So ang purpose natin is mag-fire yung trigger na ginawa natin.

03:56:59.170 --> 03:57:06.630
So isHighEarner, unahin muna natin i-create yung function.

03:57:08.030 --> 03:57:13.210
So I'll put it on top para hindi po kayo ma-confuse.

03:57:14.590 --> 03:57:18.470
So first we create a function, isHighEarner.

03:57:19.350 --> 03:57:22.910
Tapos we create, kasi mag-rereclame mo yung sabi niya

03:57:22.910 --> 03:57:25.250
kailangan i-declare yung isHighEarner.

03:57:25.410 --> 03:57:31.150
Tapos sababa, how to trigger it by insert or update.

03:58:07.450 --> 03:58:08.710
Yan, good no?

03:58:08.990 --> 03:58:15.410
Nagkita natin yung trigger na nag-fire when we insert the data.

03:59:29.630 --> 03:59:29.750
Tapos sababa, kasi mag-fire yung isHighEarner,

03:59:29.750 --> 03:59:29.830
Tapos sababa, kasi mag-fire yung isHighEarner.

03:59:44.630 --> 03:59:50.410
Ok na no? It seems nag fire yung trigger. So trigger works, correct?

04:00:27.970 --> 04:00:29.670
Nice ma'am Christine.

04:00:29.670 --> 04:00:33.970
Nakita natin na nag trigger yung ginawa niyo pong trigger.

04:00:34.990 --> 04:00:36.790
Ok, I'll continue now.

04:00:41.530 --> 04:00:50.630
So yun yung anonymous black or unnamed PL SQL blocks that are used for one time operation for testing.

04:00:50.630 --> 04:01:09.090
It's also with one time tasks such as testing reusable PL SQL module like procedure function or packages, running ad hoc data operation, prototyping or debugging PL SQL logic.

04:01:09.090 --> 04:01:26.410
So the structure of anonymous block is declare which is an optional, then begin, begin is a required, it contains executable statement, the exception which is optional and the end which is required that marks the end of the block.

04:01:27.610 --> 04:01:37.110
So the example of that is bonus, then we calculate the bonus.

04:01:37.110 --> 04:02:01.270
So again best practices in modular programming language, follow the naming convention, use a meaningful and consistent names for module like employee underscore PKJ or package, calculate underscore bonus, then use package, packages for organization.

04:02:01.270 --> 04:02:10.090
So group related procedure and function into packages, so we will dig more deeper later on with the packages and triggers.

04:02:11.410 --> 04:02:19.970
Then the benefits of that is improved readability, easier maintenance, reduce memory overhead since packages load as a unit.

04:02:19.970 --> 04:02:33.750
So it's minimize dependencies, so create self-contained modules to avoid tightly coupled code, avoid hard coding values, use parameters to make module flexible.

04:02:35.370 --> 04:02:42.430
So document the modules, so add meaningful comments and description in your code please.

04:02:42.430 --> 04:02:46.890
For procedure and function, describe the purpose, parameters and output.

04:02:47.410 --> 04:02:51.550
For packages, explain the overall purpose and key components.

04:02:52.990 --> 04:02:58.190
Then test independently, so verify each module functionality in isolation.

04:02:58.970 --> 04:03:07.370
So you can use anonymous block or SQL plus command to test, for example begin employee package.addemployee for example.

04:03:07.370 --> 04:03:16.950
So include both positive and negative test cases, mock dependent module or data if needed to focus on the target module.

04:03:19.750 --> 04:03:28.450
Then number six, optimize for use design module to be generic enough to apply multiple scenarios or application.

04:03:30.130 --> 04:03:32.450
So example of that yun nga yung calculate bonus.

04:03:33.650 --> 04:03:42.450
So siguro ang additional recommendation ko is yung error handling, make sure may exception kayo, then avoid overloading.

04:03:43.690 --> 04:03:47.630
Keep the module logic simple and focus on single responsibility.

04:03:49.610 --> 04:03:55.450
Performance optimization, use efficient queries and avoid unnecessary loops.

04:03:57.010 --> 04:04:00.790
Tapos index frequently queried columns to speed up module execution.

04:04:00.790 --> 04:04:05.030
And if you have a chance, use version controls.

04:04:05.550 --> 04:04:11.670
Use versioning to track changes in packages and procedure making it easier to roll back if needed.

04:04:12.670 --> 04:04:24.730
So adhering to modular programming best practices in PLSQL promotes maintainability, reusability and performance, ensuring robust and scalable database applications.

04:04:25.990 --> 04:04:29.090
So here's the example of PLSQL procedure.

04:04:29.090 --> 04:04:41.150
So we update the employee, then we commit the changes, then here we output, then we have the exception to handle all the error.

04:04:41.970 --> 04:04:47.090
Here we calling the procedure, this is how we can call the procedure which we already know.

04:04:47.090 --> 04:05:04.470
Here in this test case, make sure you have a test case for invalid data or negative data for example to make sure that the error will fire and to make your database more solid.

04:05:05.230 --> 04:05:14.190
Then create a procedure with, this is the example with in and out, double out as well, then with the exception.

04:05:14.190 --> 04:05:20.810
Then we have here the begin to retrieve all the employee details.

04:05:23.250 --> 04:05:38.350
So we already know that to bind our variables, so we have a variable here, we bind the data since the two data is out, so all the data will be passed here.

04:05:38.350 --> 04:05:45.850
So in this case, if we print vname, it will be the John Doe and the salary will be 75,000.

04:05:45.850 --> 04:05:56.410
If you look at here, so we bind employee name and salary as out, so it expect output parameter.

04:05:59.290 --> 04:06:10.270
Example of creating a function which we already did, so create a function, mag-input siya ng salary, so 50,000 through otherwise it falls.

04:06:10.270 --> 04:06:28.030
Then for anonymous block, so we use this begin then this is high earner, then this employee is high earner if the salary is 60,000.

04:06:28.050 --> 04:06:38.610
So here with the database data, so here the expect output will be greater than 50,000.

04:06:38.610 --> 04:06:50.610
For example, the employee ID is 101, if emp salary is less than or equal to 50,000, so the employee 101 is not higher.

04:06:51.850 --> 04:07:02.610
So if employee ID 101 does not exist, the no data found exception will be raised, so it will be on the L, so it's not a high earner.

04:07:03.600 --> 04:07:09.980
So step to execute, ensure that this high earner function exists.

04:07:11.740 --> 04:07:15.440
Yeah, I think we can try this since we have the function.

04:07:15.960 --> 04:07:26.780
Let me copy this in our Google Sheet, it will be 308, let me put that.

04:07:31.380 --> 04:07:49.860
So let's try to do this example, so we call the function if statement, since we already create a function is high earner a while ago, so this should run on your end.

04:07:49.860 --> 04:08:01.700
Let's try the slide 308, so our key point here is the select statement retrieves the employee salary from the employees table.

04:08:02.300 --> 04:08:10.300
Then we call a function is high earner, it's a function evaluates the retrieved salary to determine if the employee is high earner.

04:08:10.300 --> 04:08:18.040
Then dynamic evaluation, you can change the emp ID variable to test with different employees ID.

04:08:19.100 --> 04:08:30.600
So error handling, so we add an exception block to handle case like pag no data found or when the employee ID does not exist, any other unexpected errors.

04:08:30.780 --> 04:08:39.220
So best practices, always handle exception especially in select into statement because we don't know what might be the error.

04:08:39.220 --> 04:08:48.220
Also dynamic testing, test with valid, test with invalid data and edge case like employee's IDs.

04:08:50.560 --> 04:08:56.380
And reusability, so combine this block with other reusable components such as packages or procedure.

04:09:14.240 --> 04:09:38.980
So let's try this example, so we call the function if statement, since we already create a function is high earner, so our key point here is the select statement retrieves the employee salary from the employee table.

04:10:48.720 --> 04:11:00.320
You can try to change the variable we declare on line 33, maybe put number BMP NSQR ID 2, or I think, may error ka pa po no?

04:11:00.320 --> 04:11:07.400
Try mga po Iran, tingnan natin yung error.

04:11:11.380 --> 04:11:18.100
So let's proceed, I think every one of you got the code running correctly.

04:11:21.520 --> 04:11:37.300
So multiple condition naman tayo, so can you try to gamit naman tayo ng if else, really quick let me paste this, paste ko nalang yung if else.

04:11:42.700 --> 04:12:05.420
Or maybe I'll paste everything, so you can combine if else, so ganun pa rin, ginamit natin yung function na is high earner, dun sa if with multiple condition.

04:12:05.420 --> 04:12:19.420
So if high earner siya and EMP salary is less than 10,000, then ipo-put ngayon yung line na yun, mag-output siya ng employee earns a good salary but is not on top earner.

04:12:20.260 --> 04:12:28.860
Else if yung salary niya greater than 100,000, employee is a top earner, else this employee is not a high earner.

04:12:28.860 --> 04:12:34.640
Buma, nababokas ka ng bokas ng pinto, ang kulit mo talaga tutor, nagboig naman dito tutor.

04:12:39.700 --> 04:12:49.180
Okay the code is in Google Docs, I'll name it slide 308 if else.

04:13:04.740 --> 04:13:14.960
So you can play with the numbers, you can play with based on your database, okay 3 more minutes.

04:13:29.920 --> 04:13:31.320
Okay.

04:13:59.380 --> 04:14:00.780
Okay.

04:14:18.760 --> 04:14:24.520
Okay, I think everyone made the code running successfully.

04:14:27.380 --> 04:14:40.120
Go ahead Mamthin, salary less than 9, palitan niyo po yung 9 yung less than, alisin niyo po yung 9.

04:14:40.120 --> 04:14:45.060
There you go, awesome.

04:14:45.060 --> 04:14:47.060
Okay, I'll continue.

04:14:49.280 --> 04:14:55.320
So ito naman yung example ng trigger for salary validation which we did a while ago.

04:14:57.320 --> 04:15:00.480
So here we check the higher earner.

04:15:01.520 --> 04:15:08.000
Then a package in Pella School is a scheme object that groups related procedure function.

04:15:09.560 --> 04:15:12.320
So yun yung ina natin kanina yung package.

04:15:13.580 --> 04:15:19.880
So the step to create a package, so replace package, package name, tas yung procedure function.

04:15:21.280 --> 04:15:23.800
Itit bang na ulit siya.

04:15:26.960 --> 04:15:31.520
Okay, so deploy.

04:15:33.700 --> 04:15:35.580
So let's try to create a package.

04:15:36.140 --> 04:15:39.140
We will use it later on.

04:15:39.240 --> 04:15:41.600
Let me paste this code one moment.

04:15:41.600 --> 04:15:51.400
So it will be slides 315.

04:15:54.600 --> 04:15:57.340
Let me know if you successfully create a package.

04:16:05.320 --> 04:16:06.320
Sir, hello po.

04:16:06.400 --> 04:16:07.040
Yes po.

04:16:07.040 --> 04:16:10.060
A package body lang po talaga yung nasa.

04:16:10.340 --> 04:16:11.760
Ay, one moment po.

04:16:14.860 --> 04:16:16.480
Let me fix that code.

04:16:17.900 --> 04:16:19.220
Oh yeah, one moment.

04:16:24.920 --> 04:16:28.120
So first we will create a package.

04:16:28.620 --> 04:16:30.780
Let me paste it.

04:16:35.100 --> 04:16:38.480
So first we create a package installation.

04:16:41.160 --> 04:16:45.100
So hindi siya mag-return kasi wala pa ka-employee package.

04:16:45.780 --> 04:16:50.320
Then yung number 2 is, yun, ito na.

04:16:56.040 --> 04:16:59.620
So we can test it.

04:17:01.560 --> 04:17:05.220
So we need to create employee sequence.

04:17:07.580 --> 04:17:12.940
So we have to create a sequence here.

04:17:16.040 --> 04:17:17.840
And create a sequence.

04:17:17.840 --> 04:17:21.680
Create sequence employee sec, start with 1, increment by 1.

04:17:21.780 --> 04:17:23.720
Then we create the package body.

04:17:24.240 --> 04:17:27.380
Now we implement the method defined in the specification.

04:17:30.160 --> 04:17:35.500
So we create or replace package body, get salary, retrieve.

04:17:36.500 --> 04:17:43.180
So our EMP ID.

04:17:44.800 --> 04:17:49.840
Yung po, niligay ko na sa Google Docs.

04:18:02.120 --> 04:18:06.700
The sequence command nandun din po.

04:18:06.700 --> 04:18:18.660
Iligay ko na lang sa taas.

04:18:31.980 --> 04:18:36.160
Wala tayong employee name, palitan natin yung first name.

04:18:37.160 --> 04:18:40.180
And yung EMP ID.

04:18:51.600 --> 04:18:54.080
Tapos to test the package.

04:19:26.200 --> 04:19:29.100
Sequence, here, sequence.

04:19:36.220 --> 04:19:43.320
So possible na magkaroon kayo ng constraint violation kung nadeclear natin yung sequence na mag-start sa 1.

04:19:43.320 --> 04:19:50.980
So I suggest to start to 200 or 300, create or replace sequence.

04:20:17.400 --> 04:20:19.680
Okay, one moment.

04:20:43.320 --> 04:20:46.880
Okay, one moment.

04:21:01.680 --> 04:21:03.740
Kapag compile na po kayo ng package.

04:21:05.580 --> 04:21:11.260
Okay, great.

04:21:12.700 --> 04:21:14.060
So let's continue.

04:21:15.860 --> 04:21:19.620
So calling the procedure.

04:21:21.280 --> 04:21:23.740
You can call the add employee.

04:21:25.500 --> 04:21:28.000
Procedure to add a new employee.

04:21:29.000 --> 04:21:31.380
Then we can call a function.

04:21:31.380 --> 04:21:40.320
So here we employee package that get salary, which we declared doon sa function natin na package.

04:21:41.180 --> 04:21:42.480
Tapos sino yung ID.

04:21:42.780 --> 04:21:44.220
So we get the salary.

04:21:44.800 --> 04:21:46.760
Then we can output the salary.

04:21:48.360 --> 04:21:51.880
So private elements in package body here.

04:21:53.960 --> 04:21:58.600
So be private variable is declared inside the package body.

04:21:58.600 --> 04:22:03.220
It is not exposed in the package specification.

04:22:04.440 --> 04:22:07.300
It can only be accessed within the package body itself.

04:22:08.360 --> 04:22:15.080
So the public procedure is the add employee is declared in the package specification.

04:22:15.520 --> 04:22:18.020
So it's accessible outside the package.

04:22:19.020 --> 04:22:28.580
The procedure internally use the private variable, be private variable, to modify salary value before inserting the record into the employee's table.

04:22:29.360 --> 04:22:31.000
Number three is the encapsulation.

04:22:31.160 --> 04:22:44.500
The private variable is hidden from external access ensuring that the logic involved being be private variable is encapsulated and protected from unintended modification.

04:22:44.500 --> 04:22:51.500
So private variables is declared the package body and not visible again outside it.

04:22:52.880 --> 04:22:58.820
Then public procedure declared in the package specification and implemented in the body.

04:23:01.580 --> 04:23:06.780
So the expected outcome here will be a new record inserted into employee's table.

04:23:06.780 --> 04:23:18.000
So the salaries will be 50,000 plus 100 equals 50,100 as private variables is 100.

04:23:19.220 --> 04:23:30.900
So again the benefits of using private variables is encapsulation because it protects sensitive data or internal logic from being accessed or altered externally.

04:23:31.060 --> 04:23:33.840
It keeps the internal implementation details hidden.

04:23:33.840 --> 04:23:43.740
Also the control access, private variables can only be modified by logic within the package body ensuring consistency and flexibility.

04:23:44.160 --> 04:23:49.560
So internal variables can be modified or extended without affecting the public interface.

04:23:49.560 --> 04:24:05.940
So private variables in a package body enhance encapsulation and modularity ensuring that only intended functionality is exposed while protecting the package internal state and logic.

04:24:07.260 --> 04:24:10.400
So we mentioned that as well.

04:24:10.720 --> 04:24:25.440
So yeah again I says that modularity, the description of that is group logically related procedure, function and variables cursor into a single unit.

04:24:26.440 --> 04:24:35.920
Benefit of that is enhance the code organization and readability by categorizing related to functionalities, simplifying maintenance and debugging.

04:24:37.420 --> 04:24:44.380
So yung example natin yung procedure is yung add employee, yung function, yung get salary or calculate bonus.

04:24:44.720 --> 04:24:52.080
Then encapsulation, implementation details are hidden by exposing only the interface in the package specification.

04:24:52.080 --> 04:24:55.680
So private elements are defined in the package.

04:24:56.580 --> 04:25:04.900
So benefit, it protects internal logic and ensure that only intended function is accessible to the users.

04:25:08.120 --> 04:25:11.700
Then reusability, so pwede natin marius yung mga code.

04:25:14.380 --> 04:25:18.980
It promotes consistency and efficiency by eliminating redundancy.

04:25:18.980 --> 04:25:20.980
Also it will add performance.

04:25:22.240 --> 04:25:26.140
So the entire package is loaded into memory during the first call.

04:25:26.380 --> 04:25:31.560
So reducing the repeated this IO or input output.

04:25:32.940 --> 04:25:42.380
So the benefit of that is it reduce SQL parsing and compilation overhead kasi nililode na sya.

04:25:42.700 --> 04:25:47.200
So it improve execution speed for frequently called procedure and function.

04:25:47.200 --> 04:25:55.200
For example, we create a math package used in multiple reports for complex calculations.

04:25:55.920 --> 04:26:00.540
So it's preloaded nature reduce latency across call.

04:26:01.080 --> 04:26:04.620
So hindi mo na sya tatawagin ulit-ulit.

04:26:05.560 --> 04:26:13.200
Then of course security, so access control can be managed by granting or revoking privilege at the package level.

04:26:13.200 --> 04:26:22.060
So you can have a package that for example contain all the procedure and function that only for example for financial.

04:26:22.760 --> 04:26:24.540
So we can do that.

04:26:24.880 --> 04:26:31.500
And it simplifies the security management while ensuring sensitive operation are restricted to authorized user.

04:26:32.200 --> 04:26:40.880
For example, only HRO is granted to execute privilege on the employee package to update employee records.

04:26:40.880 --> 04:26:45.220
While read only access is given to the report viewers.

04:26:46.100 --> 04:26:46.880
So simplified maintenance.

04:26:49.220 --> 04:26:56.220
So it's provide the, you know, changing the package body does not require changes to the package specification.

04:26:57.180 --> 04:26:59.620
It's provide the interface remain consistent.

04:27:00.160 --> 04:27:07.100
Benefit of that is it enables data logic or bag fix without affecting dependent application.

04:27:08.100 --> 04:27:08.700
Okay.

04:27:09.720 --> 04:27:12.840
I think package improve code structure and readability.

04:27:13.540 --> 04:27:17.240
It enforce encapsulation and optimize performance.

04:27:17.620 --> 04:27:23.620
Also they enable reusability and centralized logic for consistent and efficient application development.

04:27:24.840 --> 04:27:27.380
Security features provide control access then.

04:27:27.600 --> 04:27:32.560
So making packages and essential component and PLSQL modular programming.

04:27:32.560 --> 04:27:38.980
So continuation of advantage of using packages is number seven, overloading.

04:27:39.100 --> 04:27:49.460
So packages allow overloading of procedure and function enabling multiple sub programs with the same name but different parameters list of types.

04:27:50.660 --> 04:27:58.820
Benefit of that is it simplifies the code by using the same name for similar functionalities while handling different input types of combination.

04:27:58.820 --> 04:28:10.920
Example of that is the calculate tax, salaries in the table, compute tax for bulk list of salaries in calculate.

04:28:13.400 --> 04:28:17.460
So gumaga yun yung package.

04:28:17.900 --> 04:28:21.080
And also a better dependency management.

04:28:21.080 --> 04:28:26.780
So a package is a specification independent of its body.

04:28:27.480 --> 04:28:33.280
Changes to the body or implementation do not affect objects that depend on the package specification.

04:28:34.300 --> 04:28:41.840
So benefit of that is it's minimize cascading recompilation ensuring system stability especially in large application.

04:28:44.160 --> 04:28:45.700
Then persistent state.

04:28:46.700 --> 04:28:49.740
So public variables declare in the package specification.

04:28:51.080 --> 04:28:54.040
Retain their values through the duration of a session.

04:28:55.200 --> 04:29:00.100
The benefit of that is also enables tracking of a session in specific state.

04:29:00.860 --> 04:29:07.560
Information or caching data to improve performance and avoid redundant computation.

04:29:08.660 --> 04:29:14.900
So for example public variables session user ID in the package stores the current user ID.

04:29:14.900 --> 04:29:25.560
So this variable can be accessed by multiple procedure like itataka natin yung activity or maybe ilalag yung event within the same session.

04:29:26.520 --> 04:29:36.740
And also error management it includes packages can include reusable and centralized error handling routines ensuring consistent error logging and reporting.

04:29:36.740 --> 04:29:45.900
So it simplifies the error handling by reducing code duplication and making error management more maintainable and traceable.

04:29:46.620 --> 04:29:59.420
Example of that is a procedure for lag error and utility package that writes error details, error code message timestamp to an error log table.

04:29:59.940 --> 04:30:04.100
Allowing developers to audit issues efficiently.

04:30:06.900 --> 04:30:08.900
Then code documentation.

04:30:09.880 --> 04:30:18.980
Packages naturally organize code into logical units with a clear interface making the purpose and usage of the package self evident.

04:30:20.500 --> 04:30:31.980
The benefit is to facilitate collaboration among the team members and is the onboarding process for the new developer by providing a centralized and well documented interface.

04:30:31.980 --> 04:30:46.980
Example of that is the report package contains all the functions and procedure for report generation such as generates summary report and export to CSV making it immediately clear what the package is designed to do.

04:30:48.080 --> 04:30:51.680
Then improve readability and manageability number 12.

04:30:52.240 --> 04:31:00.500
Packages consolidate related logic into single units simplifying navigation and reducing clutter in the database schema.

04:31:00.500 --> 04:31:09.520
It improves readability and maintainability of code especially in large scale application with numerous procedure and function.

04:31:09.520 --> 04:31:30.900
A package for example user management combines procedure for user authentication like authenticate user for role management, assigned role and logging for lag user activity into a one cohesive module making it easier to locate and manage related functionality.

04:31:33.340 --> 04:31:38.940
So packages are not just the tools for organizing and managing code.

04:31:39.500 --> 04:31:47.140
They provide a foundation for building scalable, efficient and maintainable database application.

04:31:47.140 --> 04:32:00.760
By consolidating related functionalities and enforcing best practices packages can significantly enhance the quality and reliability of PLSQL program.

04:32:03.480 --> 04:32:07.820
So what are the public sub program in PLSQL packages?

04:32:08.280 --> 04:32:17.480
So public sub programs are procedures and functions declared in the package specification and implemented in the package body.

04:32:18.080 --> 04:32:24.500
These sub programs are accessible externally providing the primary interface for interacting with the package.

04:32:25.440 --> 04:32:27.520
So what are the key features?

04:32:28.520 --> 04:32:40.240
So public sub program can be accessed by any application user or PLSQL block that has the required permission to use the package.

04:32:40.940 --> 04:32:49.460
So a procedure for example add employee and employee package can be invoked by any user with the necessary privileges.

04:32:49.460 --> 04:32:52.460
Number two is part of interface.

04:32:53.280 --> 04:33:02.420
So public sub program define the interface of the package detailing how to external user can interact with the package while hiding the implementation details.

04:33:03.260 --> 04:33:10.280
So it protects internal logic while exposing only the required functionalities.

04:33:11.520 --> 04:33:12.780
Then direct invocation.

04:33:12.780 --> 04:33:17.780
So public sub programs can be invoked directly from SQL.

04:33:18.660 --> 04:33:24.380
So if the function is deterministic and does not perform DML or insert delete update.

04:33:25.060 --> 04:33:31.260
Also in PLSQL block such as anonymous block or procedure and other packages.

04:33:31.480 --> 04:33:33.500
So enabling modular programming.

04:33:37.100 --> 04:33:43.720
So advantage of public sub programs is centralized access.

04:33:44.140 --> 04:33:51.820
Provide a single reusable interface for a package operation, modularity, security and ease of maintenance.

04:33:53.700 --> 04:33:59.500
Public sub programs in PLSQL package serve as entry point for accessing the package functionality.

04:33:59.900 --> 04:34:06.900
They provide a robust, secure and modular interface enhancing organization, reusability and maintainability.

04:34:09.000 --> 04:34:15.920
So here's the sample of public package specification.

04:34:17.440 --> 04:34:24.460
So here we replace the declare package, employee package that we did a while ago.

04:34:28.580 --> 04:34:31.000
So dropping a sub program.

04:34:31.900 --> 04:34:41.640
So dropping a sub program can invalidate objects that depend on it such as other function, procedure, triggers or packages.

04:34:42.220 --> 04:34:47.220
So dependent objects need to be recompiled or recreated after the change.

04:34:47.220 --> 04:34:56.440
So if calculate area depends with get length and get width, dropping either dependency will make calculate area invalid.

04:34:57.860 --> 04:35:00.160
So be careful in dropping it.

04:35:00.280 --> 04:35:06.380
Consider what will be the outcome if we drop certain package.

04:35:07.380 --> 04:35:15.500
So DL lagging, schema changes such as dropping altering sub programs should be lagged for auditing and traceability.

04:35:15.500 --> 04:35:23.500
Use custom lagging mechanism or database tools like Oracle Audits Rail to maintain record of such changes.

04:35:24.580 --> 04:35:31.620
So DDL mean data definition language statement executed in Oracle database.

04:35:32.020 --> 04:35:35.180
These are the operation that modify the structure of the database.

04:35:35.720 --> 04:35:41.500
Schema such as create, alter, drop, truncate, rename and comment.

04:35:42.500 --> 04:35:47.380
So the purpose of DDL lagging is for auditing, troubleshooting, debugging and recovery.

04:35:48.980 --> 04:35:59.300
So to enable the configure DDL lagging, we just type alter system set enable DDL dragging tool.

04:35:59.340 --> 04:36:05.340
Let me paste that in the slide 327.

04:36:05.340 --> 04:36:14.340
So I put in the slide 327 how to enable DDL lagging.

04:36:18.340 --> 04:36:24.300
To make this change permanent, add to the init.ora or SP file configuration.

04:36:24.600 --> 04:36:26.640
Let me paste this.

04:36:27.740 --> 04:36:39.700
So the allocation of DDL lags, once enabled, state my lag in the alert lag and separate DDL.

04:36:39.800 --> 04:36:41.720
Let me paste that.

04:36:46.040 --> 04:36:54.480
I think we can have multiple exam.

04:36:54.480 --> 04:36:58.840
I'll send now in messenger.

04:36:58.920 --> 04:37:01.080
One moment, let me grab a link.

04:37:02.380 --> 04:37:03.980
So it's just a 30 item.

04:37:05.380 --> 04:37:13.720
Once you got it, once I send you the Word docs, please create a copy.

04:37:14.080 --> 04:37:15.080
Write your name.

04:37:16.420 --> 04:37:22.120
Then export is once you're done, maybe bold the answer or color it whatever you like.

04:37:22.120 --> 04:37:25.120
Just make it whatever your answer is.

04:37:28.200 --> 04:37:35.140
Then send to me before 5 p.m. or consolidate please and email to mamcha.

04:37:38.360 --> 04:37:41.260
So here is the exam.

04:37:41.560 --> 04:37:43.320
Let me know if you all have the access.

04:37:43.540 --> 04:37:44.320
You can view it.

04:37:44.320 --> 04:37:53.880
It's a multiple choice so make a copy of the document in Google Docs then put your answer.

04:37:55.160 --> 04:37:55.860
Maybe bold.

04:37:56.280 --> 04:37:57.980
Let's make it uniform, make it bold.

04:37:58.680 --> 04:38:00.420
Then don't forget to write your name.

04:38:00.680 --> 04:38:06.040
Then after you answer, export as PDF then email it to mamcha.

04:38:06.400 --> 04:38:11.380
Then mamcha will send to me all the answer and I'll check it in my morning.

04:38:12.540 --> 04:38:12.600
Okay?

04:38:12.600 --> 04:38:13.860
Sige po.

04:38:14.340 --> 04:38:17.300
So I'm still here at 5 p.m.

04:38:17.740 --> 04:38:23.840
So just message me if I can't answer on your message.

04:38:24.400 --> 04:38:25.700
But I'm still here, okay?

04:38:34.300 --> 04:38:36.860
Smith po again ng 4.50 p.m. po.

04:38:37.500 --> 04:38:42.320
Then the deadline of answering that exam will be 4.50 p.m.

04:38:42.420 --> 04:38:42.820
Okay po?

04:38:43.940 --> 04:38:44.560
Okay po.

04:38:44.840 --> 04:38:45.580
Thank you po.

04:38:46.200 --> 04:38:50.040
Okay po.

04:39:01.740 --> 04:39:03.700
Pero pati ang tatagal ako ng classes.

04:39:04.560 --> 04:39:06.020
Susot mo kasi.

04:39:06.560 --> 04:39:07.080
Hindi mataman.

04:39:07.180 --> 04:39:07.600
No, no.

04:39:08.100 --> 04:39:10.260
Hindi yung magalit ng tarsal mo.

04:39:12.480 --> 04:39:12.920
Hindi po.

04:39:15.520 --> 04:39:16.520
Okay po.

04:39:16.780 --> 04:39:17.340
Okay po.

04:39:18.760 --> 04:39:19.320
Okay po.

04:40:16.160 --> 04:40:18.960
Okay po.

04:40:18.960 --> 04:40:19.480
Okay po.

04:40:19.480 --> 04:40:19.780
Dali.

04:40:22.480 --> 04:40:24.200
So hindi ako sleep talk ng muna-muna.

04:40:27.480 --> 04:40:28.180
Kailangan na na.

04:40:28.480 --> 04:40:29.420
Boy na.

04:40:30.160 --> 04:40:30.920
Ano boy?

04:40:31.160 --> 04:40:32.280
Mga egg boy.

04:40:32.960 --> 04:40:34.120
Mga egg boy.

04:40:35.340 --> 04:40:36.120
Mga egg boy.

04:40:36.160 --> 04:40:37.480
Hindi mag-lock ka naman.

04:40:46.080 --> 04:40:47.840
Kapag kanalinis na biniminit.

04:40:48.840 --> 04:40:49.500
Okay muna-muna.

04:41:07.940 --> 04:41:09.600
Okay, last 5 minutes.

04:41:09.760 --> 04:41:10.840
Please wrap it up.

04:41:12.700 --> 04:41:15.280
Save as PDF then send to mom chat.

04:41:15.760 --> 04:41:16.380
Thank you.

04:41:17.840 --> 04:41:18.120
ав

04:41:23.540 --> 04:41:24.100
Oh

04:41:36.400 --> 04:41:37.260
Yes po?

04:41:37.380 --> 04:41:37.820
Ano po yun?

04:41:38.280 --> 04:41:39.540
Xample nyo kanina.

04:41:39.860 --> 04:41:40.060
Yes.

04:41:40.060 --> 04:41:42.260
Bago pa tayo mag break down likelihood

04:41:43.440 --> 04:41:46.300
Ay believe you have all the PDF.

04:41:46.300 --> 04:41:47.560
Yung workshop ba?

04:41:48.560 --> 04:41:48.980
Apo.

04:41:50.020 --> 04:41:52.460
Yung result naon? Yung answer?

04:41:52.660 --> 04:41:53.180
Ganun?

04:41:53.600 --> 04:41:57.000
Yeah, I think it's on the group chat.

04:41:57.300 --> 04:41:58.080
Hindi ko po ba na-send?

04:41:58.460 --> 04:41:59.800
Let me send it again.

04:42:00.000 --> 04:42:00.600
One moment.

04:42:04.460 --> 04:42:05.180
Share

04:42:06.800 --> 04:42:07.520
Copying

04:42:09.000 --> 04:42:10.880
Okay, I pasted it

04:42:10.880 --> 04:42:12.500
in the

04:42:13.920 --> 04:42:14.640
Zoom

04:42:17.200 --> 04:42:18.200
Hello po.

04:42:18.280 --> 04:42:19.200
Yes po.

04:42:19.700 --> 04:42:22.140
Nasend ko na po via email kay Mamcha.

04:42:22.340 --> 04:42:23.600
Yung lahat po ng ano?

04:42:24.100 --> 04:42:26.160
Yung multiple choice po.

04:42:27.340 --> 04:42:27.400
Apo.

04:42:27.520 --> 04:42:29.020
Yung una sa workshop.

04:42:30.080 --> 04:42:32.300
Nire-review ko na po yung sa una.

04:42:33.520 --> 04:42:34.520
Yung sa workshop.

04:42:35.100 --> 04:42:36.060
Thank you so much.

04:42:36.480 --> 04:42:38.020
So, how is our second day?

04:42:39.260 --> 04:42:40.320
Did you learn po?

04:42:41.820 --> 04:42:42.920
Is it good na

04:42:42.920 --> 04:42:44.320
nag-code po tayo?

04:42:44.320 --> 04:42:46.440
Yes po.

04:42:47.260 --> 04:42:48.320
Mas gusto niya po

04:42:49.200 --> 04:42:50.800
Okay po.

04:42:51.000 --> 04:42:51.180
Yan.

04:42:52.760 --> 04:42:54.540
So, I have a meeting

04:42:54.540 --> 04:42:56.520
in 5pm as well.

04:42:56.900 --> 04:42:58.100
So, we have 10 minutes.

04:42:58.980 --> 04:43:00.260
In our PL SQL

04:43:00.260 --> 04:43:02.520
interactive SQL

04:43:02.520 --> 04:43:03.040
coding.

04:43:04.460 --> 04:43:06.320
Please look at the

04:43:09.000 --> 04:43:09.940
slide.

04:43:11.740 --> 04:43:12.680
One moment.

04:43:14.320 --> 04:43:16.680
Create a package

04:43:16.680 --> 04:43:18.140
slide

04:43:18.140 --> 04:43:19.400
3-8

04:43:20.320 --> 04:43:21.460
Yes.

04:43:22.100 --> 04:43:23.860
I put start on that.

04:43:25.120 --> 04:43:26.160
So, what we're doing

04:43:26.160 --> 04:43:27.680
is showing

04:43:28.320 --> 04:43:30.760
that if we delete or remove

04:43:30.760 --> 04:43:32.020
the dependencies

04:43:32.020 --> 04:43:33.600
on that

04:43:34.320 --> 04:43:34.680
function

04:43:36.320 --> 04:43:38.440
we will get a result of

04:43:38.440 --> 04:43:39.020
invalid.

04:43:40.580 --> 04:43:42.800
Again, slide 3-8.

04:43:45.080 --> 04:43:46.600
So, first

04:43:46.600 --> 04:43:48.800
we have to create a function

04:43:48.800 --> 04:43:49.900
getLength

04:43:49.900 --> 04:43:52.320
then create a function get

04:43:52.320 --> 04:43:52.920
width

04:43:54.320 --> 04:43:56.680
then create a function calculateArea

04:43:56.680 --> 04:43:58.360
but I think we already create

04:43:58.360 --> 04:44:00.320
a calculateArea so maybe put

04:44:00.320 --> 04:44:02.320
2 calculateArea2

04:44:05.300 --> 04:44:06.820
then we

04:44:06.820 --> 04:44:08.260
before we try to drop

04:44:08.260 --> 04:44:09.840
the getLength

04:44:09.840 --> 04:44:12.340
try to do the

04:44:12.340 --> 04:44:14.620
number 4 muna wherein we

04:44:14.620 --> 04:44:16.760
query the

04:44:18.340 --> 04:44:20.540
we're selecting the calculateArea

04:44:20.540 --> 04:44:21.180
2

04:44:22.340 --> 04:44:24.500
in the database and see the status

04:44:24.500 --> 04:44:26.580
of it. So, the expected

04:44:26.580 --> 04:44:28.760
output before dropping

04:44:28.760 --> 04:44:30.020
should be

04:44:30.020 --> 04:44:32.120
still valid

04:44:32.120 --> 04:44:33.040
as well.

04:44:34.860 --> 04:44:36.460
Then, quality

04:44:36.460 --> 04:44:38.160
check the calculateArea so

04:44:38.160 --> 04:44:40.300
select calculateArea2 from

04:44:40.300 --> 04:44:42.420
dual so

04:44:42.420 --> 04:44:44.120
expected output will be

04:44:44.120 --> 04:44:45.200
50

04:44:46.300 --> 04:44:48.320
since we multiply 10

04:44:48.320 --> 04:44:49.940
by 5

04:44:49.940 --> 04:44:52.480
then status

04:44:52.480 --> 04:44:53.320
query

04:44:54.300 --> 04:44:56.560
everything is in the

04:44:56.560 --> 04:44:58.540
document. I also put notes

04:44:58.540 --> 04:45:00.380
and the dependencies

04:45:00.380 --> 04:45:02.540
and

04:45:02.540 --> 04:45:04.100
recompile if invalid

04:45:04.100 --> 04:45:04.780
objects.

04:45:19.880 --> 04:45:20.640
Tomorrow

04:45:20.640 --> 04:45:20.960
po

04:45:20.960 --> 04:45:21.960
we will have

04:45:21.960 --> 04:45:23.800
another exercise

04:45:23.800 --> 04:45:25.420
more on coding so

04:45:25.420 --> 04:45:26.640
tomorrow

04:45:26.640 --> 04:45:28.000
tapusin ko lang po

04:45:28.000 --> 04:45:29.760
lahat ng

04:45:29.760 --> 04:45:31.160
slides ko

04:45:31.160 --> 04:45:32.280
then we can jump

04:45:32.280 --> 04:45:34.140
into coding na po.

04:45:34.220 --> 04:45:35.380
Okay po.

04:46:03.500 --> 04:46:04.900
Okay po.

04:46:20.660 --> 04:46:21.700
Ayos ko ba mo?

04:46:23.500 --> 04:46:24.900
Oh, pa mo mo, kumukha pa?

04:46:25.960 --> 04:46:26.820
Hindi ka pa naliligo.

04:46:27.100 --> 04:46:28.040
Ang bahawa mo pa.

04:46:29.220 --> 04:46:30.240
Ano ni, nagbiyos ka lang dami?

04:46:33.740 --> 04:46:35.820
Aris na tayo ba? Nagtehok na si Mami.

04:49:20.800 --> 04:49:21.380
Ayos ko ba?

04:49:32.520 --> 04:49:34.680
Sir, uh, good na po ba?

04:49:34.900 --> 04:49:36.440
Or tomorrow na po huli?

04:49:52.940 --> 04:49:54.040
Thank you po.

04:50:04.140 --> 04:50:05.260
Thank you.

04:50:05.260 --> 04:50:07.500
Okay, thank you po.

04:50:21.580 --> 04:50:23.280
Ba yan? Alam mo lang i-edit.

04:50:23.400 --> 04:50:24.300
Ayun, i-edit.

04:50:24.940 --> 04:50:27.500
Okay, I'm now...

04:50:29.440 --> 04:50:31.580
Hindi ka makaing nga?

04:50:44.180 --> 04:50:45.380
Ano?

04:50:46.620 --> 04:50:48.820
Oops, let's change the background.

04:50:49.440 --> 04:50:50.620
Change.

04:50:54.700 --> 04:50:55.020
Hi.

04:50:58.400 --> 04:50:59.100
Hi.

04:50:59.100 --> 04:51:01.100
Hi, pari. Nice to meet you.

04:51:01.300 --> 04:51:02.460
Nice to meet you.

04:51:03.620 --> 04:51:07.980
May kanina ben tanong pa dito sa office eh.

04:51:07.980 --> 04:51:08.480
Kaya...

04:51:08.480 --> 04:51:10.080
Yeah, this is my son,

04:51:12.400 --> 04:51:13.180
Hi, Ram.

04:51:17.300 --> 04:51:18.340
Sure, yeah.

04:51:19.280 --> 04:51:20.280
Uh, one moment.

04:51:28.800 --> 04:51:31.300
You're from what place?

04:51:31.700 --> 04:51:33.860
Sige, let's get to know each other muna.

04:51:34.420 --> 04:51:34.840
I'm...

04:51:34.840 --> 04:51:35.740
Yeah.

04:51:37.080 --> 04:51:38.500
So I'm from Das Macavite.

04:51:39.940 --> 04:51:41.480
But natira din po ako sa

04:51:41.480 --> 04:51:42.340
Valenzuela.

04:51:43.400 --> 04:51:44.500
So I'm

04:51:45.840 --> 04:51:46.680
a

04:51:46.680 --> 04:51:47.940
programmer in profession.

04:51:48.220 --> 04:51:48.780
I'm IT.

04:51:49.820 --> 04:51:52.100
I'm doing 14 years

04:51:52.100 --> 04:51:53.220
in web development.

04:51:53.660 --> 04:51:56.080
I help companies in their

04:51:56.080 --> 04:51:56.420
system,

04:51:58.080 --> 04:52:00.500
making it more easy to

04:52:00.500 --> 04:52:01.040
use,

04:52:01.340 --> 04:52:03.800
making automate all the manual

04:52:03.800 --> 04:52:05.100
tasks or processes.

04:52:06.060 --> 04:52:08.240
So I'm doing also mobile application

04:52:08.240 --> 04:52:09.580
in overseas,

04:52:10.400 --> 04:52:12.100
in several companies as well.

04:52:13.240 --> 04:52:14.320
And yeah, then

04:52:14.320 --> 04:52:15.720
just a quick

04:52:15.720 --> 04:52:16.440
background.

04:52:17.380 --> 04:52:20.520
I love badminton and last year

04:52:20.520 --> 04:52:22.080
I had a...

04:52:22.720 --> 04:52:24.320
I met coach Joard

04:52:24.320 --> 04:52:26.620
just last year then

04:52:26.620 --> 04:52:28.800
we had a really good time

04:52:28.800 --> 04:52:30.320
so every...

04:52:30.900 --> 04:52:32.060
almost every week po

04:52:32.060 --> 04:52:34.240
nag gumagala kami ganoon.

04:52:34.360 --> 04:52:36.320
Then we see the demand on the badminton

04:52:37.980 --> 04:52:38.640
world

04:52:38.640 --> 04:52:40.320
tapos the supply

04:52:40.320 --> 04:52:42.500
is few like here in Das

04:52:42.500 --> 04:52:43.720
Ma, dalawa lang.

04:52:44.380 --> 04:52:46.320
Tapos we experience is

04:52:47.000 --> 04:52:48.300
may time na pinapatayan kami

04:52:48.300 --> 04:52:50.600
ng ilaw kasi we play

04:52:50.600 --> 04:52:52.380
at TNC or sa

04:52:52.380 --> 04:52:53.440
town and country.

04:52:53.720 --> 04:52:55.980
So we had that frustration

04:52:55.980 --> 04:52:58.120
sabi nain, why not we build

04:52:58.120 --> 04:53:00.220
our own badminton court?

04:53:00.960 --> 04:53:02.140
So that's the start.

04:53:02.240 --> 04:53:03.280
We start planning

04:53:04.280 --> 04:53:06.200
for a month or two.

04:53:06.380 --> 04:53:08.460
Then we find investor

04:53:08.460 --> 04:53:10.200
so luckily we find

04:53:10.200 --> 04:53:12.180
investor and I invest my money

04:53:12.180 --> 04:53:14.380
as well. So in

04:53:14.960 --> 04:53:16.520
a month we're able

04:53:16.520 --> 04:53:18.360
to pull off

04:53:18.360 --> 04:53:19.080
everything

04:53:19.800 --> 04:53:21.380
to make it

04:53:21.380 --> 04:53:23.120
operational. It's not

04:53:23.120 --> 04:53:24.980
perfect. We had

04:53:24.980 --> 04:53:27.100
a lot of struggles

04:53:27.820 --> 04:53:29.100
but right

04:53:29.100 --> 04:53:30.860
now it's running for 6 months

04:53:30.860 --> 04:53:33.080
and I can say it's doing good

04:53:33.620 --> 04:53:35.440
and serving its purpose.

04:53:38.060 --> 04:53:39.000
yeah

04:53:39.000 --> 04:53:41.020
so again I'm IT in profession

04:53:41.020 --> 04:53:43.060
and that's the story on

04:53:43.060 --> 04:53:44.840
how I build the SSBC

04:53:44.840 --> 04:53:47.020
or the shuttle showdown badminton court.

04:53:47.020 --> 04:53:48.380
How about you sir?

04:53:49.500 --> 04:53:50.340
I'm Perry

04:53:51.240 --> 04:53:53.460
so malapit na siya dito sa

04:53:53.460 --> 04:53:54.380
MCX

04:53:55.020 --> 04:53:56.920
So right now

04:53:56.920 --> 04:53:58.240
I'm still working

04:53:58.240 --> 04:54:00.220
here in Pure Foods.

04:54:00.640 --> 04:54:02.880
Nakilala ko si

04:54:02.880 --> 04:54:03.360
Julian

04:54:04.720 --> 04:54:07.240
because of CCF

04:54:07.240 --> 04:54:09.020
kasi yung

04:54:10.100 --> 04:54:10.980
CCF

04:54:10.980 --> 04:54:12.560
would transfer

04:54:12.560 --> 04:54:13.780
to a new place

04:54:13.780 --> 04:54:15.620
na owned by Julian

04:54:16.660 --> 04:54:18.180
kasi ito

04:54:18.180 --> 04:54:19.780
kabi sa akin ni Pastor Raul

04:54:19.780 --> 04:54:21.380
yung ko owned by Julian

04:54:21.380 --> 04:54:23.600
may meron daw ino offer

04:54:23.600 --> 04:54:25.440
na investment

04:54:25.440 --> 04:54:27.680
so kaya binigin sa

04:54:27.680 --> 04:54:29.240
atin yung number

04:54:29.780 --> 04:54:31.660
ni Julian then I get your number

04:54:31.660 --> 04:54:33.280
from Julian. I see.

04:54:33.800 --> 04:54:35.760
So si

04:54:35.760 --> 04:54:37.580
Ram may isang ino

04:54:37.580 --> 04:54:39.700
is also active in sports

04:54:39.700 --> 04:54:41.540
kaya kita mo naman

04:54:41.540 --> 04:54:42.380
katawan niya

04:54:44.780 --> 04:54:45.620
so

04:54:45.620 --> 04:54:47.840
binagit ko kaya Ram

04:54:47.840 --> 04:54:49.500
kasi I'm also getting

04:54:49.500 --> 04:54:51.620
feedback or insight

04:54:52.700 --> 04:54:53.900
kaya Ram sa

04:54:53.900 --> 04:54:56.400
akin kasi there are both

04:54:56.400 --> 04:54:58.520
business inclined

04:54:58.520 --> 04:54:59.640
na mga

04:54:59.640 --> 04:55:01.320
people like me

04:55:01.320 --> 04:55:02.420
I'm employed

04:55:03.540 --> 04:55:05.760
kasi ako eh so yun

04:55:05.760 --> 04:55:08.360
we seem interested of course

04:55:08.360 --> 04:55:09.740
we still want to hear

04:55:09.740 --> 04:55:11.740
yung mga

04:55:12.400 --> 04:55:13.360
yung masasapihin mo

04:55:13.360 --> 04:55:15.220
yung mga

04:55:15.220 --> 04:55:16.440
yung mga thoughts. Ram

04:55:19.140 --> 04:55:20.480
hi sir

04:55:20.480 --> 04:55:22.000
I'm Ram

04:55:22.000 --> 04:55:23.440
yun sabi na ni

04:55:23.440 --> 04:55:25.740
Medyo active sa sports

04:55:26.260 --> 04:55:27.640
I used to play for

04:55:27.640 --> 04:55:29.040
Mapua ng college

04:55:29.740 --> 04:55:32.020
Sir graduated in Mapua?

04:55:32.320 --> 04:55:32.880
Apo apo

04:55:33.740 --> 04:55:34.560
So

04:55:34.560 --> 04:55:36.720
I graduated

04:55:36.720 --> 04:55:37.460
pero

04:55:38.720 --> 04:55:40.200
nasa creatives kami

04:55:40.200 --> 04:55:42.820
na sa photo and video

04:55:45.120 --> 04:55:47.320
tapos dito lang din ako sa

04:55:47.320 --> 04:55:48.720
Kavite sa Imus naman

04:55:49.260 --> 04:55:50.380
Sabermos naman

04:55:50.380 --> 04:55:51.920
Ah okay

04:55:51.920 --> 04:55:53.100
Lapit lang

04:55:56.240 --> 04:55:57.620
Kailangan kami sa

04:55:57.620 --> 04:55:58.260
Ulam o

04:56:00.240 --> 04:56:01.720
marami ulam

04:56:01.720 --> 04:56:02.420
lagi si Ram

04:56:04.640 --> 04:56:05.560
Yeah

04:56:05.560 --> 04:56:08.680
So yes

04:56:08.680 --> 04:56:10.840
I'm just loading the presentation right now

04:56:10.840 --> 04:56:13.220
just bear with me

04:56:13.220 --> 04:56:14.880
The canvase is really slow

04:56:14.880 --> 04:56:15.660
right now

04:56:15.660 --> 04:56:17.340
Okay it's loaded

04:56:17.340 --> 04:56:19.920
Let me share my screen

04:56:19.920 --> 04:56:21.060
So yun

04:56:21.060 --> 04:56:24.360
Really may passion is

04:56:24.360 --> 04:56:25.760
Again I'm into

04:56:25.760 --> 04:56:26.940
business na din

04:56:26.940 --> 04:56:28.600
So I resigned

04:56:28.600 --> 04:56:30.420
5 months ago

04:56:30.420 --> 04:56:32.380
Because I want to build

04:56:32.380 --> 04:56:34.500
the business especially here

04:56:34.500 --> 04:56:36.520
in Badminton kasi I see the demand

04:56:36.520 --> 04:56:37.960
I see the

04:56:37.960 --> 04:56:40.800
I see the need

04:56:40.800 --> 04:56:42.300
Can I

04:56:42.300 --> 04:56:44.480
Can you let me share my screen

04:56:44.480 --> 04:56:45.960
Thank you

04:56:48.380 --> 04:56:48.420
Okay

04:56:49.500 --> 04:56:50.140
Sure

04:56:51.580 --> 04:56:52.480
Let me

04:56:52.480 --> 04:56:53.740
share my desktop

04:56:54.560 --> 04:56:56.620
Let me know if you can see my screen

04:56:56.620 --> 04:56:57.300
Yes

04:56:58.140 --> 04:56:58.900
Yeah

04:56:58.900 --> 04:57:01.840
So we also

04:57:01.840 --> 04:57:03.360
create our branding

04:57:04.340 --> 04:57:06.700
SSBC or Shuttle Showdown

04:57:06.700 --> 04:57:08.440
This is our main logo

04:57:08.440 --> 04:57:10.500
So this is the table of contents

04:57:10.500 --> 04:57:12.560
that I will discuss to you

04:57:12.560 --> 04:57:14.900
I hope you will not get bored

04:57:14.900 --> 04:57:16.540
I'll make it fast

04:57:16.540 --> 04:57:18.780
or you can say skip if you

04:57:18.780 --> 04:57:20.780
not interested but

04:57:20.780 --> 04:57:22.540
I will discuss our company

04:57:22.540 --> 04:57:23.820
our brand

04:57:23.820 --> 04:57:25.600
why you invest in

04:57:25.600 --> 04:57:28.200
SSBC and Percus Investor

04:57:28.200 --> 04:57:29.860
and later

04:57:29.860 --> 04:57:31.100
ROI forecast

04:57:31.820 --> 04:57:33.620
I'm not sure if this

04:57:33.620 --> 04:57:35.820
Yeah let's see

04:57:36.600 --> 04:57:37.820
So our company

04:57:38.660 --> 04:57:39.900
So Shuttle

04:57:39.900 --> 04:57:41.480
Showdown is a rising

04:57:41.480 --> 04:57:43.360
trendy sport venue that provides

04:57:43.360 --> 04:57:46.000
high quality badminton courts for

04:57:46.000 --> 04:57:47.740
both amateur and

04:57:47.740 --> 04:57:49.640
professional players in order to

04:57:49.640 --> 04:57:51.640
establish individual with expertise

04:57:51.640 --> 04:57:52.980
in IT

04:57:52.980 --> 04:57:54.280
Since IT nga pa ako

04:57:54.280 --> 04:57:56.040
the one who created

04:57:58.600 --> 04:57:59.300
yung

04:57:59.300 --> 04:58:00.320
booking system

04:58:00.320 --> 04:58:02.300
and now we have POS

04:58:02.300 --> 04:58:04.280
dun sa samin

04:58:04.280 --> 04:58:06.780
tapos ang dream ko pa is

04:58:06.780 --> 04:58:08.560
magkakaroon lang sila ng RFID

04:58:08.560 --> 04:58:11.160
kasi may school management system din pa ako

04:58:11.160 --> 04:58:13.480
So I'm gonna apply the RFID

04:58:13.480 --> 04:58:14.120
function

04:58:14.120 --> 04:58:15.820
So yeah

04:58:15.820 --> 04:58:18.700
So that's my plan to have

04:58:18.700 --> 04:58:20.120
a membership card

04:58:20.120 --> 04:58:22.640
that will launch by January

04:58:22.640 --> 04:58:24.620
so you will have

04:58:24.620 --> 04:58:26.260
a credit in your RFID

04:58:26.260 --> 04:58:28.140
then just gonna top it

04:58:28.140 --> 04:58:30.140
Ang problem na sila solve nun is

04:58:30.140 --> 04:58:31.760
yung sukule

04:58:31.760 --> 04:58:33.420
tapos siyempre yung efficiency kasi

04:58:33.420 --> 04:58:36.780
it's a human problem pa rin na

04:58:36.780 --> 04:58:38.540
misa nakakamali sila ng

04:58:38.540 --> 04:58:40.680
payment or vice versa

04:58:40.680 --> 04:58:42.400
nakakamali ng sukule

04:58:42.400 --> 04:58:44.580
tapos for easy tracking of the

04:58:44.580 --> 04:58:46.500
merchandise and the foods

04:58:46.500 --> 04:58:48.620
and the court rental

04:58:48.620 --> 04:58:50.240
and also our coach is

04:58:50.240 --> 04:58:52.120
certified badminton coach

04:58:52.120 --> 04:58:54.440
so si coach George po yung partner ko

04:58:54.440 --> 04:58:55.260
right now

04:58:55.260 --> 04:58:57.860
he is BWF level 2

04:58:58.500 --> 04:59:00.400
so he has the title

04:59:00.400 --> 04:59:02.020
as well and he has

04:59:02.020 --> 04:59:04.260
a lot of

04:59:04.260 --> 04:59:06.640
experience and influence

04:59:07.400 --> 04:59:08.080
so

04:59:09.440 --> 04:59:10.500
So our mission

04:59:10.500 --> 04:59:12.320
is to serve the needs of sport

04:59:12.320 --> 04:59:14.560
into shares by establishing sports clubs

04:59:14.560 --> 04:59:16.740
in key cities in Cavite

04:59:16.740 --> 04:59:18.080
throughout the Philippines

04:59:18.080 --> 04:59:20.880
so hindi lang Cavite yung plan namin

04:59:20.880 --> 04:59:22.900
but this is just the starting point

04:59:22.900 --> 04:59:24.840
we want to build more

04:59:24.840 --> 04:59:26.660
badminton court and

04:59:26.660 --> 04:59:28.420
sport facility to

04:59:28.420 --> 04:59:30.540
other place as well

04:59:30.540 --> 04:59:32.560
because I'm saying this to be

04:59:33.360 --> 04:59:34.720
we will be

04:59:34.720 --> 04:59:36.120
a franchisor

04:59:36.120 --> 04:59:37.560
so we will

04:59:37.560 --> 04:59:40.320
we are starting creating

04:59:40.320 --> 04:59:42.420
our book na to be

04:59:42.420 --> 04:59:44.700
a franchisor para

04:59:44.700 --> 04:59:46.340
makapag-franchise yung mga

04:59:46.340 --> 04:59:48.360
gustong gumamit ng brand

04:59:48.360 --> 04:59:50.220
and everything like marketing

04:59:50.220 --> 04:59:52.740
we are collating na all the data

04:59:52.740 --> 04:59:54.480
that we have

04:59:54.480 --> 04:59:56.660
to make a franchise

05:00:00.420 --> 05:00:02.040
yun so hindi pa na ina-update

05:00:02.040 --> 05:00:04.020
so I think

05:00:04.020 --> 05:00:06.240
I'm not sure if this is the most updated but

05:00:06.240 --> 05:00:08.740
this is the founder

05:00:08.740 --> 05:00:09.940
me, Ray Villamar

05:00:09.940 --> 05:00:11.940
and my partner Joe Art Mateo

05:00:12.520 --> 05:00:13.800
and C Jam

05:00:13.800 --> 05:00:15.500
yung aming brand consultant

05:00:18.040 --> 05:00:19.920
so why SSBC?

05:00:20.580 --> 05:00:22.100
it's a badminton court brand

05:00:22.100 --> 05:00:23.860
like no other so SSBC

05:00:23.860 --> 05:00:25.940
was conceptualized by a branding expert

05:00:26.460 --> 05:00:28.080
in using internationally

05:00:28.080 --> 05:00:29.920
recognized best practices

05:00:29.920 --> 05:00:32.000
since Coach Joe Art

05:00:32.000 --> 05:00:33.620
also BWF

05:00:33.620 --> 05:00:35.640
when I say BWF badminton

05:00:35.640 --> 05:00:37.540
world federation

05:00:37.540 --> 05:00:39.560
level 2 na siya

05:00:39.560 --> 05:00:41.160
so an interior design and

05:00:41.160 --> 05:00:43.320
architectural concept of badminton courts

05:00:43.320 --> 05:00:45.600
were crafted by award winning architects

05:00:45.600 --> 05:00:47.760
of today generation

05:00:47.760 --> 05:00:49.460
then it

05:00:49.460 --> 05:00:50.920
infused with technology

05:00:51.840 --> 05:00:53.540
like yung booking system

05:00:54.140 --> 05:00:55.340
tapos magkakarin din ng

05:00:55.340 --> 05:00:57.160
cubing management system

05:00:57.160 --> 05:00:59.880
so no this cutting edge badminton court

05:00:59.880 --> 05:01:01.720
incorporates a booking

05:01:01.720 --> 05:01:03.380
system to enhance accessibility

05:01:03.380 --> 05:01:05.320
and also a home court

05:01:05.320 --> 05:01:07.320
to one out

05:01:07.320 --> 05:01:09.180
of four certified badminton trainer

05:01:09.180 --> 05:01:10.560
coaches in Cavite

05:01:10.560 --> 05:01:13.120
signaling credibility to the place

05:01:13.120 --> 05:01:15.500
so nag-add in ang value si

05:01:15.500 --> 05:01:16.640
Coach Joe Art

05:01:17.320 --> 05:01:18.900
konte lang silang

05:01:18.900 --> 05:01:21.180
certified na trainer

05:01:21.180 --> 05:01:23.100
ng end coaches here

05:01:23.100 --> 05:01:24.200
in Cavite

05:01:26.020 --> 05:01:27.360
so our core

05:01:27.360 --> 05:01:29.180
values so we're customer

05:01:29.180 --> 05:01:31.240
centric so we value customer

05:01:31.240 --> 05:01:32.260
needs

05:01:33.580 --> 05:01:34.380
feedback

05:01:34.380 --> 05:01:36.500
and strive to exceed expectation

05:01:36.500 --> 05:01:38.480
so we really

05:01:38.480 --> 05:01:39.520
on hand to

05:01:40.260 --> 05:01:41.580
ask them what

05:01:42.260 --> 05:01:44.340
they want to see

05:01:44.340 --> 05:01:46.560
that they want in the badminton

05:01:46.560 --> 05:01:48.260
courts so our customer centric

05:01:48.900 --> 05:01:50.680
approach foster innovation

05:01:50.680 --> 05:01:52.420
shape interaction

05:01:52.420 --> 05:01:54.220
and guides decision making

05:01:54.220 --> 05:01:56.520
to enhance the overall experience

05:01:56.520 --> 05:01:58.520
in creating long lasting

05:01:58.520 --> 05:02:00.380
relationship and a supportive community

05:02:00.380 --> 05:02:02.620
also we want to have

05:02:02.620 --> 05:02:04.540
a top of the line experience so we

05:02:04.540 --> 05:02:06.600
prioritize top notch player experience

05:02:06.600 --> 05:02:08.540
with inclusivity

05:02:08.540 --> 05:02:10.540
so our facilities are

05:02:10.540 --> 05:02:12.440
top notch providing top of the line

05:02:12.440 --> 05:02:14.140
court flooring

05:02:14.140 --> 05:02:16.740
we use taraflex and a high quality

05:02:16.740 --> 05:02:18.800
lighting for optimal performance

05:02:18.800 --> 05:02:20.980
lahat po nang pupunta sa

05:02:20.980 --> 05:02:21.980
court namin di say

05:02:21.980 --> 05:02:24.320
uy ang ganda ng ilo niyo uy ang ganda ng

05:02:24.320 --> 05:02:26.720
taraflex and we want to maintain

05:02:26.720 --> 05:02:27.580
that

05:02:27.580 --> 05:02:30.020
then we also have passions

05:02:30.020 --> 05:02:32.080
to sports so our core values includes

05:02:32.080 --> 05:02:33.800
a passion for sport

05:02:33.800 --> 05:02:35.560
teamwork and integrity so

05:02:35.560 --> 05:02:37.740
driving success in athletic

05:02:37.740 --> 05:02:39.700
endeavors and you know creating

05:02:39.700 --> 05:02:41.780
a supportive environment for

05:02:41.780 --> 05:02:43.520
active development also

05:02:43.520 --> 05:02:45.520
our commitment to foster community

05:02:45.520 --> 05:02:47.800
so we

05:02:47.800 --> 05:02:48.400
have

05:02:49.240 --> 05:02:51.920
we want to enhance the badminton experience by fostering

05:02:51.920 --> 05:02:53.100
community through

05:02:53.100 --> 05:02:55.640
tournaments workshop and personalized

05:02:55.640 --> 05:02:56.640
training session

05:02:56.640 --> 05:02:58.840
connecting players and promoting

05:02:58.840 --> 05:03:00.500
growth so we had

05:03:00.500 --> 05:03:02.820
6 successful tournaments

05:03:02.820 --> 05:03:04.360
na i think more than

05:03:04.360 --> 05:03:06.160
6 to 8 tournaments

05:03:06.160 --> 05:03:08.200
within 6 months

05:03:08.200 --> 05:03:10.780
so we have like 1 or 2

05:03:10.780 --> 05:03:12.020
tournament per month

05:03:12.020 --> 05:03:15.000
some other are hosted with us

05:03:15.000 --> 05:03:16.820
especially me and

05:03:16.820 --> 05:03:18.500
other are my friends

05:03:18.500 --> 05:03:20.540
so we're hosting tournament

05:03:21.640 --> 05:03:22.280
and the

05:03:22.280 --> 05:03:24.220
feedback is

05:03:24.220 --> 05:03:26.440
really positive also i want to add

05:03:26.440 --> 05:03:28.120
that we have a burden

05:03:28.120 --> 05:03:30.160
to especially if

05:03:30.160 --> 05:03:32.420
we have the capacity or means

05:03:32.420 --> 05:03:34.180
we want to build a badminton

05:03:34.180 --> 05:03:36.280
court as a donation in

05:03:36.280 --> 05:03:37.160
some

05:03:38.280 --> 05:03:40.280
provinces that really deprive

05:03:41.060 --> 05:03:42.420
of you know

05:03:42.420 --> 05:03:44.400
having a good facility because

05:03:44.400 --> 05:03:45.980
of their location

05:03:45.980 --> 05:03:48.240
so we're

05:03:48.240 --> 05:03:49.440
dreaming that as well

05:03:51.020 --> 05:03:52.700
so our brand

05:03:52.700 --> 05:03:54.360
so ssbc brand

05:03:54.360 --> 05:03:56.060
promise is to bring joy

05:03:56.060 --> 05:03:58.600
and satisfaction for every badminton

05:03:58.600 --> 05:04:00.400
enthusiast in the Philippines

05:04:00.400 --> 05:04:01.440
our tagline is

05:04:01.980 --> 05:04:03.920
we're champion trains and

05:04:03.920 --> 05:04:04.880
dreams take flight

05:04:04.880 --> 05:04:07.680
so our brand personality is we're fun

05:04:07.680 --> 05:04:09.100
jolly

05:04:09.100 --> 05:04:10.960
we're humble we're learner

05:04:10.960 --> 05:04:13.440
inclusive outspoken

05:04:14.000 --> 05:04:15.760
hospitable and profession

05:04:16.980 --> 05:04:18.320
so this is

05:04:18.320 --> 05:04:19.640
our logo mark

05:04:19.640 --> 05:04:21.760
this is the full logo of the

05:04:21.760 --> 05:04:23.420
shuttle showdown

05:04:23.420 --> 05:04:25.960
so as you can see it's

05:04:25.960 --> 05:04:27.720
like a racket

05:04:27.720 --> 05:04:29.760
side by side

05:04:30.760 --> 05:04:31.760
it's the

05:04:32.280 --> 05:04:33.340
logo variation

05:04:35.060 --> 05:04:36.400
then this is

05:04:36.400 --> 05:04:37.980
our key elements

05:04:37.980 --> 05:04:39.060
so here

05:04:39.760 --> 05:04:41.980
the branding just showing

05:04:41.980 --> 05:04:43.940
that all

05:04:43.940 --> 05:04:45.220
the elements

05:04:45.940 --> 05:04:48.020
that we're showing has all

05:04:48.020 --> 05:04:49.940
the meaning like this symbolize

05:04:50.580 --> 05:04:51.940
opening or more opportunities

05:04:51.940 --> 05:04:52.980
in the future

05:04:53.940 --> 05:04:56.080
this illustration badminton racket

05:04:56.080 --> 05:04:58.340
symbolizing the sport ssb

05:04:58.340 --> 05:04:59.640
currently offers

05:04:59.640 --> 05:05:01.900
and arrows portray movement and

05:05:01.900 --> 05:05:03.480
direction in moving forward

05:05:03.480 --> 05:05:05.940
then shuttlecock illustration of

05:05:05.940 --> 05:05:07.940
shuttlecock symbolizing the

05:05:07.940 --> 05:05:10.380
sports in ssbc

05:05:12.800 --> 05:05:13.600
so

05:05:13.600 --> 05:05:15.160
this is the

05:05:15.160 --> 05:05:16.360
creative mood board

05:05:16.360 --> 05:05:18.680
that we are thinking

05:05:18.680 --> 05:05:20.740
though it's not yet implemented

05:05:20.740 --> 05:05:22.800
because we

05:05:22.800 --> 05:05:24.960
prioritize what we need

05:05:24.960 --> 05:05:26.500
in the court but

05:05:26.500 --> 05:05:28.660
this is the dream or the

05:05:28.660 --> 05:05:30.720
concept in the interior design

05:05:32.240 --> 05:05:34.660
so this is the interior design

05:05:34.660 --> 05:05:36.480
so some of them are

05:05:36.480 --> 05:05:38.520
implemented like the

05:05:38.520 --> 05:05:40.520
umpire chair, the blue

05:05:43.100 --> 05:05:43.980
tela

05:05:44.520 --> 05:05:46.980
tapos we have monitor na

05:05:46.980 --> 05:05:48.440
though one but our

05:05:48.440 --> 05:05:50.540
goal is each court will have

05:05:50.540 --> 05:05:52.440
their own monitor especially

05:05:52.440 --> 05:05:54.960
when we implement the

05:05:54.960 --> 05:05:56.580
queuing management

05:05:56.580 --> 05:05:58.620
app which i'm doing in progress

05:05:58.620 --> 05:06:00.400
then a silhouette

05:06:00.400 --> 05:06:02.760
of badminton

05:06:02.760 --> 05:06:03.900
player

05:06:05.020 --> 05:06:06.940
then on the

05:06:06.940 --> 05:06:08.940
side we will have the stalls

05:06:08.940 --> 05:06:10.820
the office

05:06:10.820 --> 05:06:13.340
then the lockers

05:06:13.340 --> 05:06:14.680
then and the

05:06:14.680 --> 05:06:16.640
restroom so this is right now

05:06:16.640 --> 05:06:18.980
currently designed for the size

05:06:18.980 --> 05:06:21.220
of our

05:06:21.220 --> 05:06:22.520
badminton court

05:06:24.100 --> 05:06:26.920
then we will have some messaging

05:06:26.920 --> 05:06:28.920
on each

05:06:28.920 --> 05:06:30.700
on each

05:06:30.700 --> 05:06:32.960
panel in the court

05:06:32.960 --> 05:06:34.960
say a lab ssbc or play with

05:06:35.720 --> 05:06:38.120
then on the exterior design

05:06:38.960 --> 05:06:40.460
though it's not yet implemented

05:06:40.460 --> 05:06:42.600
but the only implemented

05:06:42.600 --> 05:06:44.480
is the ssbc here

05:06:44.480 --> 05:06:46.720
but the silhouette is

05:06:46.720 --> 05:06:48.700
and the painting is not yet implemented

05:06:48.700 --> 05:06:51.340
so why invest in ssbc

05:06:51.340 --> 05:06:52.600
so

05:06:52.600 --> 05:06:55.220
only in ssbc

05:06:55.220 --> 05:06:56.400
we have training camps

05:06:56.400 --> 05:06:58.200
so we have accredited coach

05:06:58.200 --> 05:06:59.640
coach joard

05:06:59.640 --> 05:07:02.640
accredited in badminton world federation

05:07:02.640 --> 05:07:05.120
it's maximized the home court advantage

05:07:05.120 --> 05:07:06.880
training both aspiring

05:07:06.880 --> 05:07:08.420
and professional badminton players

05:07:08.420 --> 05:07:09.960
at shutter showdown

05:07:10.640 --> 05:07:12.800
also we have only in

05:07:12.800 --> 05:07:14.280
the kavite

05:07:14.280 --> 05:07:16.420
only as the ssbc have the

05:07:16.420 --> 05:07:17.480
booking system

05:07:17.480 --> 05:07:19.800
so walang nagugulo

05:07:20.640 --> 05:07:22.760
the convenient of they can pay

05:07:22.760 --> 05:07:24.620
they can book

05:07:24.620 --> 05:07:26.540
prior and they can see

05:07:26.540 --> 05:07:28.640
may available pa na

05:07:29.460 --> 05:07:29.940
court

05:07:29.940 --> 05:07:31.660
so this ensure players

05:07:31.660 --> 05:07:33.740
of the court is serve

05:07:33.740 --> 05:07:35.840
providing them with assurance

05:07:35.840 --> 05:07:37.860
having designated court

05:07:37.860 --> 05:07:38.580
for the game

05:07:38.580 --> 05:07:41.140
and also aesthetic inside the court

05:07:41.140 --> 05:07:42.640
so this is in progress

05:07:42.640 --> 05:07:45.500
but we're making it aesthetic at least

05:07:45.500 --> 05:07:48.020
branded by internationally recognized

05:07:48.020 --> 05:07:49.740
best practices and award winning

05:07:49.740 --> 05:07:50.380
architects

05:07:50.380 --> 05:07:53.600
so the court offer more than just a place to play

05:07:53.600 --> 05:07:54.920
it's a social hub

05:07:54.920 --> 05:07:57.460
to spend time with friends and family

05:07:57.460 --> 05:07:59.240
complete with

05:07:59.240 --> 05:08:01.020
instagram worthy photos

05:08:01.020 --> 05:08:02.420
and community building

05:08:02.420 --> 05:08:05.400
so one of our commitments is reflected in the design

05:08:05.400 --> 05:08:06.640
of our facilities

05:08:07.460 --> 05:08:09.220
aim at fostering a sense of community

05:08:09.220 --> 05:08:11.060
that will transform the badminton courts

05:08:11.060 --> 05:08:13.500
into vibrant community clubs

05:08:19.940 --> 05:08:22.040
so our approach

05:08:22.040 --> 05:08:25.440
is to have a franchise badminton court

05:08:25.440 --> 05:08:27.880
a purse of it's kind in branding

05:08:27.880 --> 05:08:29.600
so the badminton court is

05:08:29.600 --> 05:08:31.220
set to revolutionize the way into

05:08:32.080 --> 05:08:33.480
experience the badminton

05:08:33.480 --> 05:08:35.520
with state of the art facilities

05:08:35.520 --> 05:08:37.900
so yun talaga yung dream namin

05:08:37.900 --> 05:08:39.520
tapos mayroon tayong

05:08:39.520 --> 05:08:40.740
professional coaching

05:08:41.440 --> 05:08:43.120
coach, high quality flooring

05:08:43.120 --> 05:08:45.340
nataraflex and of course

05:08:45.340 --> 05:08:46.500
digital platform

05:08:46.500 --> 05:08:49.340
so using their card, using their mobile

05:08:49.340 --> 05:08:50.740
they can pay

05:08:52.060 --> 05:08:53.440
even the lights

05:08:53.440 --> 05:08:55.640
i can automatically turn

05:08:55.640 --> 05:08:57.580
it up and on kasi

05:08:57.580 --> 05:08:59.460
nakakonek namin sa

05:08:59.460 --> 05:09:01.360
smart switch

05:09:01.360 --> 05:09:03.620
so and i already program

05:09:03.620 --> 05:09:04.900
yung on and off

05:09:04.900 --> 05:09:06.780
kasi i have that also in my home

05:09:07.440 --> 05:09:09.420
so i just need to hook

05:09:09.420 --> 05:09:11.440
that once the

05:09:13.040 --> 05:09:13.760
membership

05:09:13.760 --> 05:09:15.120
is on

05:09:17.980 --> 05:09:19.740
magkakaroon ang our

05:09:19.740 --> 05:09:21.360
investment services is we will have

05:09:21.360 --> 05:09:23.320
a quarterly financial report

05:09:23.320 --> 05:09:25.500
then booking and queuing system

05:09:25.500 --> 05:09:26.340
upgrades

05:09:26.340 --> 05:09:27.820
tapos mga optional

05:09:28.980 --> 05:09:31.280
operational services and also

05:09:31.280 --> 05:09:33.320
we are considering to offer

05:09:33.320 --> 05:09:35.320
a co-ownership

05:09:35.320 --> 05:09:37.320
so with a range of investment

05:09:37.320 --> 05:09:39.160
services we are committed to helping our

05:09:39.160 --> 05:09:41.220
investors to achieve their financial goals

05:09:41.220 --> 05:09:43.280
at all best way possible

05:09:43.280 --> 05:09:45.140
so our team of experienced advisor

05:09:45.140 --> 05:09:46.580
work closely with us

05:09:46.580 --> 05:09:49.220
to understand the target market, unique needs

05:09:49.220 --> 05:09:51.260
and tailor strategies that aligns our goals

05:09:53.360 --> 05:09:55.320
so if you invest

05:09:55.320 --> 05:09:57.460
to us we will have a quarterly financial

05:09:57.460 --> 05:09:59.600
report to maintain transparency

05:09:59.600 --> 05:10:01.420
and keep our investor

05:10:01.420 --> 05:10:03.180
well informed about the company progress

05:10:03.180 --> 05:10:04.400
and future prospects

05:10:05.460 --> 05:10:06.420
also shared

05:10:07.160 --> 05:10:09.080
profit updates, up to date

05:10:09.080 --> 05:10:11.280
accumulated profit reports

05:10:11.280 --> 05:10:12.780
investment status

05:10:12.780 --> 05:10:15.460
reassurance ensure investment

05:10:15.460 --> 05:10:17.660
are well taken

05:10:17.660 --> 05:10:19.800
and expenses

05:10:19.800 --> 05:10:20.780
and overhead

05:10:20.780 --> 05:10:23.900
so you will see how much the expenses

05:10:23.900 --> 05:10:25.380
overhead costs

05:10:25.380 --> 05:10:27.740
transparency and expense and overhead

05:10:27.740 --> 05:10:29.660
costs affecting financial status

05:10:31.840 --> 05:10:33.940
then booking and queuing

05:10:33.940 --> 05:10:34.860
system upgrades

05:10:34.860 --> 05:10:37.860
lagi tayo nag-upgrade every month

05:10:37.860 --> 05:10:39.460
at least we launch

05:10:39.460 --> 05:10:41.580
a new feature

05:10:41.580 --> 05:10:42.700
product

05:10:43.660 --> 05:10:44.560
sa court

05:10:44.560 --> 05:10:46.840
then optional

05:10:46.840 --> 05:10:48.160
operational services

05:10:48.160 --> 05:10:50.880
ito yung isang offer namin

05:10:50.880 --> 05:10:52.920
na okay

05:10:52.920 --> 05:10:54.400
pero it's not yet final

05:10:54.400 --> 05:10:56.480
so just remember numbers

05:10:56.480 --> 05:10:57.580
not yet final

05:10:57.580 --> 05:10:59.880
so we can talk about it

05:10:59.880 --> 05:11:01.860
but this is the idea that

05:11:01.860 --> 05:11:04.220
50% owned by the SSBC

05:11:04.220 --> 05:11:06.620
then 50% owned by the investor

05:11:06.620 --> 05:11:08.360
then the operation

05:11:08.360 --> 05:11:10.640
handled will be by

05:11:10.640 --> 05:11:12.340
SSBC for investor who

05:11:12.340 --> 05:11:14.340
just invest their money

05:11:17.900 --> 05:11:19.760
the other one

05:11:20.960 --> 05:11:22.340
the other one

05:11:23.220 --> 05:11:24.580
is co-ownership

05:11:24.580 --> 05:11:26.520
it is a flexible share agreement

05:11:26.520 --> 05:11:28.700
depending on investor capabilities

05:11:28.700 --> 05:11:29.440
and demand

05:11:29.440 --> 05:11:32.340
we're just limiting up to four

05:11:33.140 --> 05:11:34.360
co-owners

05:11:34.360 --> 05:11:36.260
group investor

05:11:36.260 --> 05:11:38.380
to build a one

05:11:38.380 --> 05:11:39.860
SSBC branch

05:11:39.860 --> 05:11:41.980
kasi pag marami na

05:11:41.980 --> 05:11:43.540
pag lumagpas na ng four

05:11:43.540 --> 05:11:46.140
five medyo magulo na

05:11:46.140 --> 05:11:48.280
so i think four is the maximum

05:11:48.280 --> 05:11:50.000
in one SSBC

05:11:50.000 --> 05:11:52.040
branch if they want

05:11:52.040 --> 05:11:53.280
to for example

05:11:53.860 --> 05:11:55.320
magtayo sa ibang lugar

05:11:55.860 --> 05:11:57.740
so hanggang four lang ng mga

05:11:57.740 --> 05:11:59.860
co-owners para hindi siya magulo

05:12:03.540 --> 05:12:04.380
location

05:12:05.860 --> 05:12:07.960
namin isyan nga sa

05:12:07.960 --> 05:12:09.840
sa

05:12:09.840 --> 05:12:11.300
Manggahan

05:12:11.300 --> 05:12:13.880
kasi very strategic talaga yun

05:12:13.880 --> 05:12:15.800
kasi gitnas siya

05:12:15.800 --> 05:12:18.060
the place is really

05:12:18.060 --> 05:12:19.740
good gitnas siya

05:12:19.740 --> 05:12:21.660
walang badminton court sa

05:12:21.660 --> 05:12:23.420
Manggahan sa Trece

05:12:23.960 --> 05:12:25.960
sa Amadeo

05:12:26.740 --> 05:12:27.640
so

05:12:27.640 --> 05:12:30.140
yung galing silang malapit lang

05:12:30.140 --> 05:12:31.820
galing Daxma malapit lang

05:12:31.820 --> 05:12:33.240
din so

05:12:33.960 --> 05:12:36.020
yun yung isa namin nakintang

05:12:36.020 --> 05:12:37.440
yung strategic location yung

05:12:38.020 --> 05:12:39.280
Julian tapos nabing

05:12:39.280 --> 05:12:40.380
kalsada pa siya

05:12:40.380 --> 05:12:44.120
so for me it's really good

05:12:46.700 --> 05:12:48.760
so as investor

05:12:50.020 --> 05:12:51.200
ito yung mga perks

05:12:51.200 --> 05:12:52.660
it may change

05:12:52.660 --> 05:12:54.620
but this is the initial

05:12:54.620 --> 05:12:56.820
perks so court rental

05:12:56.820 --> 05:12:58.080
four hours per month

05:12:58.080 --> 05:12:59.520
non-convertible to cash

05:12:59.520 --> 05:13:01.320
perceived value at 800

05:13:01.320 --> 05:13:03.540
then five percent discount on

05:13:03.540 --> 05:13:05.420
all merchandise

05:13:05.420 --> 05:13:07.220
and food and beverages

05:13:07.220 --> 05:13:09.460
then pre-badminton training

05:13:09.460 --> 05:13:11.320
coaching for up to six sessions per year

05:13:11.960 --> 05:13:12.880
kay coach George

05:13:12.880 --> 05:13:15.660
then automatic upgrade to VIP membership

05:13:15.660 --> 05:13:17.380
so more benefits

05:13:17.380 --> 05:13:18.300
to be advised

05:13:19.680 --> 05:13:21.380
so pag one million

05:13:21.380 --> 05:13:22.620
we just

05:13:23.320 --> 05:13:25.700
add eight hours court rental

05:13:25.700 --> 05:13:27.320
then ten percent on all

05:13:28.280 --> 05:13:29.620
food and beverages

05:13:29.620 --> 05:13:32.100
and merchandise tapos

05:13:32.100 --> 05:13:33.740
may pre-badminton training

05:13:33.740 --> 05:13:35.620
coaching up to twelve sessions per year

05:13:36.180 --> 05:13:37.740
the perceived value is twelve

05:13:37.740 --> 05:13:39.740
thousand pesos then automatic

05:13:39.740 --> 05:13:41.440
upgrade to VIP membership

05:13:42.360 --> 05:13:43.780
i think i can make

05:13:43.780 --> 05:13:45.680
it like platinum we have now

05:13:45.680 --> 05:13:46.820
a platinum membership

05:13:48.060 --> 05:13:50.120
so again this is

05:13:50.120 --> 05:13:51.220
a example

05:13:51.220 --> 05:13:54.020
but it closely to the numbers

05:13:54.020 --> 05:13:55.600
for example

05:13:55.600 --> 05:13:57.880
you invest 500k

05:13:57.880 --> 05:13:59.880
and you want a monthly

05:14:00.580 --> 05:14:01.660
ROI plan

05:14:01.660 --> 05:14:03.560
so you will guaranteed to pay

05:14:03.560 --> 05:14:05.880
25,000

05:14:08.320 --> 05:14:09.000
guaranteed

05:14:10.240 --> 05:14:10.920
then

05:14:10.920 --> 05:14:13.700
maganda yung benta talaga

05:14:14.560 --> 05:14:15.740
pwede siyang tumas

05:14:15.740 --> 05:14:17.980
up to seven to ten percent

05:14:17.980 --> 05:14:18.740
per month

05:14:19.880 --> 05:14:21.360
so if you invest

05:14:21.880 --> 05:14:23.960
800k for example you will receive

05:14:23.960 --> 05:14:25.880
a guaranteed of 40,000

05:14:25.880 --> 05:14:26.220
per month

05:14:30.360 --> 05:14:32.280
do you have a question

05:14:32.280 --> 05:14:34.100
24 months

05:14:35.820 --> 05:14:37.640
two year returns

05:14:37.640 --> 05:14:39.840
you just multiplied it to 24

05:14:39.840 --> 05:14:40.720
yes po

05:14:40.720 --> 05:14:43.300
five percent yes po

05:14:43.880 --> 05:14:45.560
so parang

05:14:45.560 --> 05:14:47.060
kumita yung pera mo

05:14:47.880 --> 05:14:48.700
for example for two year

05:14:48.700 --> 05:14:52.360
100,000 yung 500k mo

05:14:52.360 --> 05:14:53.240
but

05:14:53.240 --> 05:14:54.560
we are returning it

05:14:55.240 --> 05:14:55.600
monthly

05:14:56.780 --> 05:14:59.280
so 500,000

05:14:59.280 --> 05:15:00.800
yes so 25

05:15:00.800 --> 05:15:03.240
for two years

05:15:04.920 --> 05:15:05.960
yun

05:15:05.960 --> 05:15:07.040
yung five percent

05:15:08.840 --> 05:15:11.580
yes po yes yes

05:15:11.580 --> 05:15:13.300
so meaning the five percent

05:15:13.300 --> 05:15:15.520
is already demonstrated

05:15:15.520 --> 05:15:17.240
yes po

05:15:18.400 --> 05:15:20.280
kaya po

05:15:20.280 --> 05:15:21.420
kaya yung

05:15:21.420 --> 05:15:23.700
five percent yes po

05:15:24.980 --> 05:15:26.300
per month

05:15:28.200 --> 05:15:29.880
yes po

05:15:29.880 --> 05:15:31.420
since six

05:15:31.420 --> 05:15:33.460
actually hindi ko pa masabi hundred percent

05:15:33.460 --> 05:15:35.460
because it's just six months yung first three

05:15:35.460 --> 05:15:37.440
months nagpapakilala pa

05:15:37.440 --> 05:15:39.840
lang pero for example

05:15:39.840 --> 05:15:41.580
to be

05:15:41.580 --> 05:15:43.340
transparent ang grow

05:15:43.340 --> 05:15:45.620
sales namin nung October is

05:15:45.620 --> 05:15:46.800
308,000

05:15:46.800 --> 05:15:48.720
so 308,000

05:15:48.720 --> 05:15:49.260
so

05:15:50.300 --> 05:15:52.500
yun nga lang marami expenses like

05:15:52.500 --> 05:15:54.720
marami kaming gustong ipabili kaya

05:15:55.920 --> 05:15:56.760
halos

05:15:56.760 --> 05:15:57.720
wala din

05:15:58.720 --> 05:16:00.120
tapos yun nagpapakapit pa kami

05:16:00.720 --> 05:16:01.640
CCTV

05:16:02.720 --> 05:16:04.060
yun nga yung experience namin

05:16:04.060 --> 05:16:05.120
dyan sa warehouse

05:16:05.120 --> 05:16:07.880
yung isang bad experience is

05:16:08.720 --> 05:16:10.860
hindi sinabi sa amin na

05:16:10.860 --> 05:16:12.740
nagpapadeliver pala sila ng tubig

05:16:12.740 --> 05:16:14.280
or may problem sa water

05:16:14.280 --> 05:16:17.020
could you imagine our bill

05:16:17.020 --> 05:16:19.200
no September

05:16:19.200 --> 05:16:21.140
sa water lang alone

05:16:21.140 --> 05:16:23.020
is 25,000

05:16:24.020 --> 05:16:24.780
because

05:16:24.780 --> 05:16:27.340
the rate is so high

05:16:27.340 --> 05:16:29.440
because hindi

05:16:29.440 --> 05:16:30.780
hindi enough yung supply

05:16:30.780 --> 05:16:32.880
ni prime water that's why

05:16:32.880 --> 05:16:35.020
they need to deliver sa private

05:16:35.600 --> 05:16:36.460
entity

05:16:37.020 --> 05:16:38.160
in that

05:16:38.160 --> 05:16:40.640
the cost of that is

05:16:40.640 --> 05:16:43.380
higher yung water rate

05:16:43.380 --> 05:16:45.160
but right now

05:16:45.160 --> 05:16:47.100
this November they already resolved

05:16:47.100 --> 05:16:49.340
that hopefully hindi na maulid

05:16:49.340 --> 05:16:50.840
so bumaba na kasi

05:16:50.840 --> 05:16:53.340
nasa prime na ulit

05:16:55.600 --> 05:16:56.460
yes

05:16:56.460 --> 05:16:57.400
yes

05:16:57.400 --> 05:16:58.760
in my existing location correct

05:16:59.740 --> 05:17:01.460
sa Dasmaka

05:17:01.460 --> 05:17:02.320
Vita sa may

05:17:02.320 --> 05:17:05.340
yes sa Dasmaka Vita sa

05:17:05.340 --> 05:17:07.040
malapit sa Vista Mall

05:17:09.440 --> 05:17:10.300
Dasmaka

05:17:10.300 --> 05:17:11.340
or malapit sa

05:17:11.340 --> 05:17:12.900
Walter Mart pinapagitaan

05:17:12.900 --> 05:17:14.900
o siya

05:17:15.580 --> 05:17:16.900
yun po

05:17:18.860 --> 05:17:20.540
tapos yun

05:17:20.540 --> 05:17:22.320
pag quarterly naman

05:17:22.320 --> 05:17:25.040
for example we promised 7%

05:17:25.040 --> 05:17:26.840
so you will receive

05:17:26.840 --> 05:17:28.800
every quarter of

05:17:28.800 --> 05:17:31.400
150,000

05:17:31.400 --> 05:17:32.760
again don't

05:17:32.760 --> 05:17:34.600
confuse I'm not promising

05:17:34.600 --> 05:17:36.360
the numbers yet

05:17:36.900 --> 05:17:38.320
it can change

05:17:38.320 --> 05:17:40.540
so still we need the contract

05:17:40.540 --> 05:17:42.800
whatever we promised in the contract

05:17:42.800 --> 05:17:44.660
we will give it

05:17:44.660 --> 05:17:46.740
and we also have a business

05:17:46.740 --> 05:17:49.000
coach and consultant

05:17:49.000 --> 05:17:50.300
so

05:17:50.300 --> 05:17:52.760
we're yet to finalize it

05:17:52.760 --> 05:17:54.000
so we're

05:17:54.540 --> 05:17:56.260
yeah we're thinking

05:17:56.260 --> 05:17:59.020
actually we're thinking kasi na

05:17:59.020 --> 05:18:00.080
bumili talaga

05:18:00.080 --> 05:18:02.560
ng lupa tapos patayuan

05:18:02.560 --> 05:18:04.220
siya kasi it's more advisable

05:18:04.220 --> 05:18:06.120
like we're paying

05:18:06.120 --> 05:18:08.480
100 rent alone

05:18:08.480 --> 05:18:10.780
kasi tas ang mahal pa ng kusa

05:18:10.780 --> 05:18:11.880
when I say kusa

05:18:12.480 --> 05:18:14.380
it's like a homeowner association

05:18:14.380 --> 05:18:14.920
use

05:18:14.920 --> 05:18:18.340
homeowner association use is 38,000

05:18:18.340 --> 05:18:20.280
then our rent is

05:18:20.280 --> 05:18:22.020
126,000

05:18:22.020 --> 05:18:23.600
so para mga

05:18:23.600 --> 05:18:26.780
160,000 just for rent alone

05:18:26.780 --> 05:18:27.540
sabi ko nga

05:18:27.540 --> 05:18:30.620
if I can pay 160,000

05:18:30.620 --> 05:18:32.140
right 180,000 per month

05:18:32.140 --> 05:18:33.900
why not I make it alone

05:18:34.480 --> 05:18:36.120
or gather investor

05:18:36.120 --> 05:18:38.360
tapos we build our own

05:18:38.360 --> 05:18:39.520
diba

05:18:40.120 --> 05:18:42.000
we build our own kasi may demand

05:18:42.000 --> 05:18:43.940
naman po talaga and

05:18:43.940 --> 05:18:45.980
hindi maubos ang mga player kasi

05:18:45.980 --> 05:18:47.640
yung mga bata lalaki

05:18:47.640 --> 05:18:49.740
tapos may mga bata pa

05:18:49.740 --> 05:18:50.520
lalaki

05:18:51.640 --> 05:18:53.680
tapos it's already

05:18:53.680 --> 05:18:56.160
kung baga we already have the

05:18:56.160 --> 05:18:57.200
network

05:18:58.120 --> 05:18:59.360
actually we're planning

05:18:59.360 --> 05:19:01.400
actually we're looking for another

05:19:02.120 --> 05:19:04.100
another I'm looking for a land

05:19:04.100 --> 05:19:06.140
that we can build talaga

05:19:07.860 --> 05:19:09.400
wala pa

05:19:09.400 --> 05:19:11.840
but it's really

05:19:11.840 --> 05:19:14.300
parang high risk kasi

05:19:14.300 --> 05:19:16.180
parang papatak na ang rent

05:19:16.180 --> 05:19:18.280
sa kanya 300,000 to 400,000

05:19:18.280 --> 05:19:19.020
per month

05:19:20.080 --> 05:19:22.140
yeah it's really

05:19:22.140 --> 05:19:22.880
risky

05:19:24.100 --> 05:19:26.340
if you can pay 400,000

05:19:26.340 --> 05:19:27.980
or 350,000

05:19:27.980 --> 05:19:30.100
per 1,000

05:19:30.720 --> 05:19:31.820
square meter to

05:19:31.820 --> 05:19:33.300
1,400

05:19:33.820 --> 05:19:36.080
diba why not strategize

05:19:36.080 --> 05:19:37.820
to get

05:19:37.820 --> 05:19:39.880
investment on some

05:19:39.880 --> 05:19:41.640
people now willing to invest

05:19:41.640 --> 05:19:43.600
then build

05:19:43.600 --> 05:19:45.860
kung baga we buy

05:19:45.860 --> 05:19:47.860
a land na everything

05:19:47.860 --> 05:19:49.760
is owner or

05:19:49.760 --> 05:19:51.940
kasi may investor at least we have

05:19:51.940 --> 05:19:53.820
the physical or the

05:19:54.420 --> 05:19:56.240
we have the property

05:19:56.240 --> 05:19:57.820
na we can liquidate

05:19:57.820 --> 05:19:59.760
and you know the property the value

05:19:59.760 --> 05:20:01.580
is along

05:20:01.580 --> 05:20:03.760
sa kahabaan ng panahon tumataas

05:20:05.000 --> 05:20:05.780
yes

05:20:05.780 --> 05:20:07.700
and yeah yeah

05:20:07.700 --> 05:20:09.540
so right now

05:20:09.540 --> 05:20:11.300
based on experience in 6 months

05:20:12.180 --> 05:20:13.960
it's good naman kasi

05:20:13.960 --> 05:20:15.960
wala naman kaming utang and

05:20:15.960 --> 05:20:17.240
nababayaran naman lahat ng

05:20:17.760 --> 05:20:19.760
but I see it

05:20:20.400 --> 05:20:21.660
the renting

05:20:21.660 --> 05:20:23.780
is not a long term for me

05:20:23.780 --> 05:20:25.940
I really want to build

05:20:25.940 --> 05:20:27.420
you know saka

05:20:27.420 --> 05:20:29.660
yung mas maganda yung mas malaki

05:20:29.660 --> 05:20:31.040
malagay natin na ibang

05:20:31.860 --> 05:20:32.540
facilities

05:20:35.740 --> 05:20:37.540
yung itong numbers na to

05:20:37.540 --> 05:20:39.280
you say it may change but

05:20:40.320 --> 05:20:41.480
close to this

05:20:41.480 --> 05:20:42.920
number parin

05:20:42.920 --> 05:20:43.540
hindi naman

05:20:45.580 --> 05:20:46.940
hindi naman

05:20:46.940 --> 05:20:49.400
kasi kung baga we want

05:20:49.400 --> 05:20:51.620
we want to return to the

05:20:51.620 --> 05:20:53.200
investment to investor

05:20:53.200 --> 05:20:55.080
especially and

05:20:57.420 --> 05:20:59.440
kung magako I'm willing to put my money

05:20:59.440 --> 05:21:01.440
din eh kasi I see really the

05:21:01.440 --> 05:21:03.460
demand that tapos kung

05:21:03.460 --> 05:21:05.600
nilagin pa siya ng system

05:21:05.600 --> 05:21:07.060
tapos yung tao

05:21:07.060 --> 05:21:09.420
dalawa lang or tatlo

05:21:10.320 --> 05:21:11.660
it will run

05:21:11.660 --> 05:21:13.380
and the maintenance

05:21:13.380 --> 05:21:15.640
hindi naman din ganun kalaki

05:21:15.640 --> 05:21:17.420
yun ilaw lang tubig

05:21:18.780 --> 05:21:19.420
so

05:21:19.420 --> 05:21:21.420
I'm still positive with

05:21:22.140 --> 05:21:23.520
the badminton business

05:21:23.520 --> 05:21:25.340
especially malagin pa natin siya

05:21:25.340 --> 05:21:26.800
kanyari we can

05:21:26.800 --> 05:21:29.520
find a place na

05:21:29.520 --> 05:21:31.160
na ibang

05:21:32.180 --> 05:21:33.120
sports

05:21:33.120 --> 05:21:35.520
like yung pickle ball

05:21:35.520 --> 05:21:37.640
na sumisikat na

05:21:37.640 --> 05:21:38.900
pickle ball

05:21:38.900 --> 05:21:39.940
basketball

05:21:39.940 --> 05:21:42.860
so yeah

05:21:42.860 --> 05:21:45.360
actually we have that plan

05:21:45.360 --> 05:21:47.120
just need

05:21:47.120 --> 05:21:48.440
kasi misang busy din ako

05:21:48.440 --> 05:21:50.280
I have my own company

05:21:51.340 --> 05:21:53.220
so but I'm really positive

05:21:53.220 --> 05:21:54.400
on this one

05:21:55.220 --> 05:21:56.620
just to say

05:21:57.220 --> 05:21:59.100
so this is the sample

05:21:59.100 --> 05:22:00.980
of the yearly ROI

05:22:00.980 --> 05:22:03.220
plan if we put 8%

05:22:04.820 --> 05:22:07.120
so you can have

05:22:07.120 --> 05:22:09.500
1.4 million in 2 years

05:22:09.500 --> 05:22:10.520
time because

05:22:11.220 --> 05:22:13.160
based on my later

05:22:13.160 --> 05:22:14.780
calculation before

05:22:14.780 --> 05:22:17.220
we can be ROI in 2-3 years

05:22:18.080 --> 05:22:19.500
2 years is

05:22:19.500 --> 05:22:20.980
the most

05:22:20.980 --> 05:22:21.720
positive

05:22:21.720 --> 05:22:23.920
in 3 years is like

05:22:23.920 --> 05:22:26.100
okay so if there's some issue

05:22:26.100 --> 05:22:26.760
something like that

05:22:27.860 --> 05:22:28.780
back

05:22:28.780 --> 05:22:32.900
yung 720,000

05:22:32.900 --> 05:22:33.840
I'm trying to compute

05:22:33.840 --> 05:22:35.880
500,000 times

05:22:35.880 --> 05:22:38.520
8%

05:22:38.520 --> 05:22:40.980
that's 40,000

05:22:41.880 --> 05:22:43.400
so yung 40,000

05:22:43.400 --> 05:22:44.740
I'm

05:22:44.740 --> 05:22:46.520
multiply it to

05:22:46.520 --> 05:22:48.020
how did you get

05:22:48.020 --> 05:22:50.020
720,000

05:22:52.000 --> 05:22:57.600
how did you get 720,000

05:23:00.020 --> 05:23:00.780
kasi kung

05:23:02.020 --> 05:23:03.040
annual kasi to

05:23:04.020 --> 05:23:06.260
100 times 8

05:23:06.260 --> 05:23:07.920
that's 40,000

05:23:07.920 --> 05:23:09.180
try to multiply

05:23:10.480 --> 05:23:11.580
that's

05:23:11.580 --> 05:23:14.000
480,000

05:23:14.000 --> 05:23:15.880
so ini bumabuhayin 720,000

05:23:15.880 --> 05:23:17.880
oh nga

05:23:22.040 --> 05:23:23.940
yeah I think

05:23:23.940 --> 05:23:26.220
mali po yung calculation dito

05:23:26.220 --> 05:23:28.060
kasi if you apply that

05:23:28.060 --> 05:23:29.480
it will be 44%

05:23:30.440 --> 05:23:31.960
right right

05:23:31.960 --> 05:23:33.940
yes po I will

05:23:34.900 --> 05:23:35.660
okay

05:23:36.520 --> 05:23:38.220
yeah sorry for that

05:23:38.220 --> 05:23:39.020
confusion

05:23:39.880 --> 05:23:41.900
so I think I'm almost done

05:23:41.900 --> 05:23:43.220
so as franchise

05:23:44.620 --> 05:23:45.460
kasi

05:23:45.460 --> 05:23:49.160
so yun kasi inisip namin na

05:23:49.160 --> 05:23:51.220
maggawa talaga na maging franchisor

05:23:51.900 --> 05:23:53.220
tapos kanyari yung ibang lugar

05:23:54.000 --> 05:23:55.460
gusto yung mag franchise

05:23:55.460 --> 05:23:57.380
pag naboo na namin yung marketing

05:23:57.380 --> 05:23:59.580
yung everything from start

05:23:59.580 --> 05:24:01.540
tapos how it operate

05:24:01.540 --> 05:24:03.300
tapos kagawan

05:24:03.300 --> 05:24:04.940
ng book tapos mag

05:24:06.020 --> 05:24:06.860
paparegister

05:24:06.860 --> 05:24:09.120
pwede na tayong maging franchisor ng

05:24:09.120 --> 05:24:09.960
sports

05:24:09.960 --> 05:24:10.800
I think

05:24:12.560 --> 05:24:13.920
hindi po

05:24:13.920 --> 05:24:15.400
may two ways

05:24:15.960 --> 05:24:17.960
siyempre we cannot manage naman

05:24:20.200 --> 05:24:22.080
yung kumagayaman physical

05:24:22.080 --> 05:24:23.940
at siya it's not scalable

05:24:23.940 --> 05:24:26.160
so they will the one who manage

05:24:26.160 --> 05:24:28.060
that's why they will have the

05:24:28.060 --> 05:24:30.020
book ang role nalang

05:24:30.020 --> 05:24:32.140
po namin ni Jordan is parang consultancy

05:24:32.140 --> 05:24:33.960
or visitation

05:24:33.960 --> 05:24:35.880
or meeting yun nga consultant

05:24:35.880 --> 05:24:37.820
kung anong gagawin

05:24:37.820 --> 05:24:39.640
like we have a lot of programs

05:24:39.640 --> 05:24:41.880
like yung clinic, camps

05:24:41.880 --> 05:24:43.660
tapos yung mga promotion

05:24:45.460 --> 05:24:46.220
yeah

05:24:47.540 --> 05:24:49.060
yes po

05:24:49.060 --> 05:24:50.740
kasi we have our branding

05:24:50.740 --> 05:24:53.900
we sing the branding

05:24:53.900 --> 05:24:55.940
at least

05:24:55.940 --> 05:24:57.920
here in national in the

05:24:57.920 --> 05:24:58.500
Philippines

05:24:59.820 --> 05:25:00.940
thank you po

05:25:00.940 --> 05:25:01.860
thank you for listening

05:25:07.820 --> 05:25:08.400
this question

05:25:12.560 --> 05:25:15.980
sir Ray salamat po sa

05:25:15.980 --> 05:25:17.300
presentation natin

05:25:17.300 --> 05:25:19.480
mayroon lang ako ika clarify

05:25:19.480 --> 05:25:20.320
yes po sir

05:25:20.320 --> 05:25:23.060
yung investment natin

05:25:23.060 --> 05:25:24.960
saan gagamitin naman

05:25:24.960 --> 05:25:26.760
that's for a different

05:25:27.820 --> 05:25:29.820
brand ba sa lalabas

05:25:29.820 --> 05:25:31.580
same brand

05:25:31.580 --> 05:25:33.460
SSBC

05:25:33.460 --> 05:25:34.880
tapos

05:25:34.880 --> 05:25:36.860
actually you're

05:25:36.860 --> 05:25:38.500
the second one na nag

05:25:38.500 --> 05:25:40.460
presenta namin

05:25:40.460 --> 05:25:42.880
just a few friends

05:25:43.500 --> 05:25:44.820
and

05:25:44.820 --> 05:25:47.340
the concept is

05:25:47.340 --> 05:25:48.780
for

05:25:48.780 --> 05:25:50.280
another branch

05:25:50.880 --> 05:25:52.940
ng SSBC for example

05:25:52.940 --> 05:25:54.680
sa emus

05:25:54.680 --> 05:25:56.940
or sabako or ganoon

05:25:56.940 --> 05:25:58.680
so maghanap tayo, magtatayo

05:25:58.680 --> 05:26:00.800
tayo kasi may supply na kami

05:26:00.800 --> 05:26:03.100
ng taraflex and ilaw and everything

05:26:03.100 --> 05:26:04.820
so we can

05:26:04.820 --> 05:26:07.240
kami sinetap lang namin ng a month

05:26:07.240 --> 05:26:08.880
or plus 10 days

05:26:08.880 --> 05:26:10.960
mga 40 days

05:26:11.780 --> 05:26:13.040
set a finding

05:26:13.040 --> 05:26:15.100
supplier but it will be more

05:26:16.940 --> 05:26:18.480
mas may cleaner siya kasi

05:26:18.480 --> 05:26:20.760
we have the supplier na nung una naghanap kami ng

05:26:20.760 --> 05:26:22.520
supplier, nag-aantay

05:26:22.520 --> 05:26:24.720
but now we have a reliable supplier

05:26:24.720 --> 05:26:26.880
na magkakabit ng taraflex

05:26:26.880 --> 05:26:29.420
magre-renovate, mag-aayos

05:26:29.420 --> 05:26:30.520
gano

05:26:30.520 --> 05:26:32.220
so i'm looking for investor

05:26:32.220 --> 05:26:33.500
for the next

05:26:34.520 --> 05:26:36.400
court na ita tayo

05:26:36.400 --> 05:26:39.000
so vali wala pa tayong definition

05:26:39.000 --> 05:26:39.640
for this

05:26:40.520 --> 05:26:42.620
unfortunately wala pa po

05:26:42.620 --> 05:26:44.320
so that means

05:26:44.320 --> 05:26:46.520
wala pa rin yung parang

05:26:47.980 --> 05:26:48.640
nagiging

05:26:48.640 --> 05:26:50.580
monthly rental sa warehouse

05:26:50.580 --> 05:26:52.380
for example or expenses

05:26:53.580 --> 05:26:54.500
wala pa

05:26:54.500 --> 05:26:55.940
kung yung kay Julian

05:26:56.520 --> 05:26:57.660
kinumpit ko

05:26:59.260 --> 05:27:00.520
nagkumpit na ako noon yung

05:27:00.520 --> 05:27:01.140
kay Julian

05:27:01.660 --> 05:27:02.680
kasong mahal talaga

05:27:02.680 --> 05:27:04.100
pero maganda din yung kita

05:27:04.100 --> 05:27:07.620
if gagawin siyang 24 hours

05:27:07.620 --> 05:27:09.540
it's really good

05:27:11.100 --> 05:27:12.140
pwede naman

05:27:12.140 --> 05:27:13.760
kasa lang pag naisip ko na

05:27:14.980 --> 05:27:16.340
yung sustainability

05:27:16.340 --> 05:27:17.100
na parang kailangan

05:27:17.660 --> 05:27:19.620
mas sustain mo siya ng a year

05:27:19.620 --> 05:27:21.620
kasi magpapakilala ka

05:27:21.620 --> 05:27:24.120
kukuha ka ng mga

05:27:24.120 --> 05:27:25.340
kontak ka ng mga schools

05:27:25.340 --> 05:27:26.520
sa mga companies

05:27:26.520 --> 05:27:29.320
so it takes a year for them

05:27:29.320 --> 05:27:31.120
to gather parang gano

05:27:31.120 --> 05:27:33.380
yeah i offer Julian

05:27:33.380 --> 05:27:34.760
as investor as well

05:27:34.760 --> 05:27:37.040
sabi ko nga Julian ilibri mo muna

05:27:37.040 --> 05:27:39.340
ako ng 6 months tapos yun ang investment mo

05:27:40.480 --> 05:27:41.200
tapos

05:27:41.200 --> 05:27:41.640
ano

05:27:42.420 --> 05:27:44.380
may investment value ka na

05:27:44.380 --> 05:27:47.740
magbabayad na kami ng rent

05:27:47.740 --> 05:27:49.040
per month tapos

05:27:49.040 --> 05:27:51.340
may shares na siya

05:27:52.360 --> 05:27:52.960
um

05:27:52.960 --> 05:27:54.720
kakosapin niya daw yung nasa taas

05:27:54.720 --> 05:27:56.140
kasi ano lang siya

05:27:57.020 --> 05:27:59.140
nag-joke pa ngayon eh

05:27:59.140 --> 05:28:00.740
tag-sunod lang daw siya

05:28:00.740 --> 05:28:03.640
sabi niya

05:28:03.640 --> 05:28:05.180
yeah yung father niya

05:28:05.180 --> 05:28:06.560
pero nag-isip din kami yung

05:28:06.560 --> 05:28:07.700
ram na ano

05:28:07.700 --> 05:28:09.480
kasi sa SSBC

05:28:09.480 --> 05:28:11.780
dito ngayon yung current now running

05:28:11.780 --> 05:28:14.200
nag-isip din kami

05:28:14.200 --> 05:28:16.280
magpasok ng isa ang ganda

05:28:16.280 --> 05:28:17.240
lang ang investor

05:28:19.240 --> 05:28:21.120
ang purpose naman nung is

05:28:21.120 --> 05:28:24.300
um yun mag-i-improve pa

05:28:24.300 --> 05:28:25.300
um may

05:28:25.300 --> 05:28:27.240
konti na lang naman more on internal

05:28:28.560 --> 05:28:29.340
tapos

05:28:29.340 --> 05:28:31.120
siyempre ang ano rin is

05:28:31.120 --> 05:28:33.260
kunyari kagaya mo na for example businessman

05:28:33.260 --> 05:28:35.480
you can contribute

05:28:35.480 --> 05:28:37.120
din how to

05:28:37.120 --> 05:28:39.480
ano pa how to

05:28:39.480 --> 05:28:41.480
make it profitable pa

05:28:42.380 --> 05:28:43.160
yun

05:28:43.160 --> 05:28:44.760
but it's not yet

05:28:44.760 --> 05:28:46.120
un-final

05:28:46.120 --> 05:28:49.220
kasi kami dalo ni Joe Archung nag-di-decide

05:28:49.220 --> 05:28:50.200
which is my partner

05:28:55.220 --> 05:28:56.380
yes pwede

05:28:56.380 --> 05:28:58.380
tapos we can look siguro yung

05:28:59.220 --> 05:29:00.380
financial statement

05:29:00.380 --> 05:29:02.020
or annual report siguro

05:29:02.020 --> 05:29:04.360
or even monthly reports kasi 6 months pa lang yung company

05:29:04.360 --> 05:29:06.180
6 months pa lang pwede naman

05:29:06.180 --> 05:29:08.800
we can do that for sure

05:29:09.520 --> 05:29:10.960
tapos kung ports natin

05:29:10.960 --> 05:29:11.900
dun is how many?

05:29:11.900 --> 05:29:12.500
4

05:29:13.900 --> 05:29:15.860
250 pesos per hour per court

05:29:17.900 --> 05:29:18.340
yes

05:29:19.920 --> 05:29:20.920
540

05:29:23.900 --> 05:29:25.380
so wala na siyang room for

05:29:26.600 --> 05:29:27.600
parang

05:29:27.600 --> 05:29:29.080
palakihan

05:29:29.080 --> 05:29:31.900
wala na no no

05:29:33.280 --> 05:29:36.200
sagad na siya

05:29:36.200 --> 05:29:36.440
sagad na siya

05:29:36.440 --> 05:29:38.400
misan po bisita po kayo

05:29:38.400 --> 05:29:39.700
let's meet there

05:29:41.040 --> 05:29:41.640
tapo

05:29:41.640 --> 05:29:43.640
so yun yung papunta

05:29:43.640 --> 05:29:45.300
kasi kung

05:29:45.300 --> 05:29:47.700
galing ako ng governor strike

05:29:49.140 --> 05:29:49.740
so

05:29:50.460 --> 05:29:51.060
kaliwa

05:29:52.440 --> 05:29:53.860
kakaliwa ka pa vista mall

05:29:53.860 --> 05:29:55.860
pag-itas mo ng vista mall yun ay po yung

05:29:56.780 --> 05:29:57.380
samin

05:29:57.380 --> 05:29:59.820
kakanan ka dun sa may mga warehouse ng JNT

05:30:01.140 --> 05:30:01.740
copy project

05:30:01.740 --> 05:30:03.380
yes po copy project correct

05:30:03.380 --> 05:30:05.700
yun yung paway yun

05:30:06.220 --> 05:30:07.700
yes po so dire-direcho

05:30:07.700 --> 05:30:10.180
yes po

05:30:11.460 --> 05:30:13.100
dun sa left mo may

05:30:14.900 --> 05:30:15.580
BASIO

05:30:15.580 --> 05:30:17.160
tapos sa kanan

05:30:17.700 --> 05:30:20.140
may malawak na

05:30:21.240 --> 05:30:21.920
kalasada

05:30:21.920 --> 05:30:23.580
which is yun yung dana ng mga

05:30:23.580 --> 05:30:25.060
truck JNT dun kami

05:30:25.780 --> 05:30:26.460
papasoknan

05:30:28.660 --> 05:30:30.020
yes correct

05:30:30.020 --> 05:30:31.460
anggang 12 midnight po

05:30:31.460 --> 05:30:32.640
ATM to 12 midnight

05:30:39.300 --> 05:30:39.960
so

05:30:39.960 --> 05:30:41.600
ano pa yung

05:30:41.600 --> 05:30:43.700
i-enhance po sa kanya

05:30:43.700 --> 05:30:45.860
kung maximize na yung

05:30:45.860 --> 05:30:47.820
area niya

05:30:48.540 --> 05:30:49.540
after nung

05:30:49.540 --> 05:30:51.700
CCTV mga monitors

05:30:52.340 --> 05:30:54.080
tapos yung

05:30:54.080 --> 05:30:55.480
yung mga internal like yung

05:30:55.480 --> 05:30:57.220
silhouette saka yung external

05:30:57.220 --> 05:30:59.680
yun po yung mga yung mga nandon sa

05:30:59.680 --> 05:31:01.800
plan yun po yung gusto namin i-implement

05:31:01.800 --> 05:31:03.480
yes po yun

05:31:03.480 --> 05:31:05.400
how you say that

05:31:05.400 --> 05:31:07.400
yung mga customers would still increase

05:31:08.500 --> 05:31:10.920
it will add a value

05:31:10.920 --> 05:31:13.580
especially kung each court will have

05:31:13.580 --> 05:31:15.400
monitor and it have a system

05:31:15.400 --> 05:31:17.820
of for example like queuing

05:31:17.820 --> 05:31:19.400
kasi one of the biggest

05:31:19.400 --> 05:31:21.140
chunk na

05:31:21.140 --> 05:31:23.160
nag-rent every night is

05:31:23.160 --> 05:31:24.600
yung mga queue master

05:31:25.400 --> 05:31:27.080
which they do their queuing

05:31:27.080 --> 05:31:29.600
so tayo lang yung may ganung

05:31:30.400 --> 05:31:31.120
system

05:31:31.120 --> 05:31:33.140
na may queuing system na

05:31:33.140 --> 05:31:35.520
may kita yung score o may kita yung

05:31:35.520 --> 05:31:37.480
yung kasunod na maglalaro

05:31:39.140 --> 05:31:40.820
max ka ng ano yun

05:31:40.820 --> 05:31:42.380
sa ba na talagang magiging

05:31:43.140 --> 05:31:45.140
kasi otherwise

05:31:46.620 --> 05:31:47.580
kung

05:31:47.580 --> 05:31:48.960
so i think

05:31:48.960 --> 05:31:50.920
tamang possible you might

05:31:50.920 --> 05:31:51.580
proceed

05:31:53.140 --> 05:31:55.160
yung financial statements

05:31:55.160 --> 05:31:56.040
sure

05:31:56.040 --> 05:31:58.460
may questions pa ako

05:31:59.140 --> 05:32:01.160
doon sa investment

05:32:01.160 --> 05:32:02.280
part ulit

05:32:02.280 --> 05:32:05.000
for example hindi kami pumasa doon sa

05:32:05.000 --> 05:32:06.880
existing courts nyo

05:32:06.880 --> 05:32:08.820
magkana yung biniim yung

05:32:10.400 --> 05:32:11.280
i

05:32:11.280 --> 05:32:13.240
buoin para sa bagong

05:32:13.240 --> 05:32:14.920
SSBC branch

05:32:14.920 --> 05:32:16.860
kung mag rent

05:32:19.340 --> 05:32:21.320
tapos mga 1,000 square

05:32:21.320 --> 05:32:23.520
meter mga 6 million

05:32:23.520 --> 05:32:24.700
pero kung

05:32:24.700 --> 05:32:27.320
pero kung bibili tayo

05:32:27.320 --> 05:32:29.240
for example yung price

05:32:29.240 --> 05:32:30.380
ng warehouse

05:32:31.240 --> 05:32:33.500
is 10 million

05:32:33.500 --> 05:32:35.340
tapos pwede namang hulog

05:32:35.340 --> 05:32:37.660
yan yung for example yung lupa

05:32:37.660 --> 05:32:39.360
siguro mga 15

05:32:39.360 --> 05:32:40.980
million 15 to 20 million

05:32:40.980 --> 05:32:43.020
the good thing with that naman is we own the lot

05:32:43.020 --> 05:32:45.500
we have our own property

05:32:45.500 --> 05:32:46.980
tapos siyempre pag

05:32:46.980 --> 05:32:49.740
tinayayan pa siya ng warehouse type

05:32:49.740 --> 05:32:51.240
na matas yung ceiling

05:32:52.780 --> 05:32:53.400
anything

05:32:53.400 --> 05:32:54.680
we put there

05:32:55.240 --> 05:32:56.820
it's the investor property

05:32:56.820 --> 05:32:58.800
whoever invests

05:32:58.800 --> 05:32:59.640
with them

05:33:02.660 --> 05:33:03.740
up to

05:33:03.740 --> 05:33:04.660
up to 4 investor lang

05:33:04.660 --> 05:33:06.640
so medyo malaking

05:33:06.640 --> 05:33:08.300
investment siya lalas

05:33:08.300 --> 05:33:10.080
hindi yung parang 500,000

05:33:10.820 --> 05:33:12.680
for example yung isang

05:33:12.680 --> 05:33:14.980
kakailalan namin

05:33:14.980 --> 05:33:17.140
kanyar iririkoy natin

05:33:17.140 --> 05:33:18.120
2 million

05:33:18.820 --> 05:33:20.380
siya lang kausap natin

05:33:20.380 --> 05:33:23.060
marami siyang may group siya

05:33:23.060 --> 05:33:24.080
na investor din

05:33:24.080 --> 05:33:25.680
basta siya lang yung representative

05:33:25.680 --> 05:33:28.000
or kausap

05:33:28.000 --> 05:33:30.360
kasi pag maraming investor

05:33:30.360 --> 05:33:32.240
based din sa

05:33:32.240 --> 05:33:33.780
ano namin is magulo

05:33:33.780 --> 05:33:36.140
otherwise you can give me more positive

05:33:36.140 --> 05:33:37.120
impact

05:33:37.120 --> 05:33:38.960
pag maraming investor

05:33:38.960 --> 05:33:42.020
but for me I discourage

05:33:42.020 --> 05:33:43.420
a lot of investor

05:33:44.940 --> 05:33:45.740
maybe

05:33:46.760 --> 05:33:47.560
maybe

05:33:48.080 --> 05:33:49.900
we can strategize like

05:33:49.900 --> 05:33:52.260
we can build a shares

05:33:52.260 --> 05:33:54.560
then they can buy a shares

05:33:54.560 --> 05:33:56.260
but they have no voting power

05:33:56.260 --> 05:33:58.760
at least what I'm saying is

05:33:58.760 --> 05:34:00.180
only poor person

05:34:00.940 --> 05:34:02.360
can have a voting

05:34:02.360 --> 05:34:03.840
power something like that

05:34:03.840 --> 05:34:05.860
we do it like share

05:34:05.860 --> 05:34:08.740
hindi ko pa nakakalculate

05:34:08.740 --> 05:34:09.840
yeah

05:34:09.840 --> 05:34:11.660
ganun so magkakaroon tayo kasi

05:34:11.660 --> 05:34:13.880
for example ako invest 2 million

05:34:13.880 --> 05:34:15.860
invest 4 million so mas

05:34:15.860 --> 05:34:17.900
malaki yung shares mo

05:34:17.900 --> 05:34:19.880
tapos siyempre

05:34:19.880 --> 05:34:21.380
may voting power ka din

05:34:21.380 --> 05:34:23.340
when it comes to decision

05:34:24.660 --> 05:34:25.880
I'm planning to build

05:34:25.880 --> 05:34:27.260
a corporation

05:34:27.880 --> 05:34:29.760
wherein may board

05:34:29.760 --> 05:34:31.840
tayo and you're one of

05:34:31.840 --> 05:34:33.580
the investor para pagdating

05:34:33.580 --> 05:34:35.900
ng meeting okay so here's the

05:34:35.900 --> 05:34:37.340
plan so

05:34:37.340 --> 05:34:40.320
may voting power tayo

05:34:40.320 --> 05:34:42.180
tempre the more you

05:34:42.180 --> 05:34:43.800
kumiko yung pinakamataas mas matas

05:34:43.800 --> 05:34:44.660
yung voting power

05:34:45.480 --> 05:34:47.940
so hindi sabihin siyo

05:34:49.000 --> 05:34:50.860
pwede pa kami pumili ng shares

05:34:50.860 --> 05:34:52.920
1% for example

05:34:55.720 --> 05:34:56.760
siguro yun

05:34:56.760 --> 05:34:58.760
maybe we can ask yung preso per

05:34:58.760 --> 05:34:59.500
share

05:34:59.500 --> 05:35:02.940
kung magkana yung

05:35:03.840 --> 05:35:05.220
valuation ng company

05:35:05.220 --> 05:35:06.060
yeah

05:35:06.940 --> 05:35:08.500
we'll make it legal lang

05:35:08.500 --> 05:35:10.940
kasi I cannot ask

05:35:12.060 --> 05:35:12.780
investor

05:35:12.780 --> 05:35:14.160
agad agad

05:35:14.160 --> 05:35:16.140
and I learned I should

05:35:16.140 --> 05:35:18.500
be allowed

05:35:18.500 --> 05:35:20.400
to accept

05:35:20.400 --> 05:35:21.840
investor

05:35:23.080 --> 05:35:23.880
so

05:35:23.880 --> 05:35:26.660
I just make it legal for us

05:35:26.660 --> 05:35:28.420
also for your protection as well

05:35:28.420 --> 05:35:30.320
as investor na

05:35:30.320 --> 05:35:32.080
you're protected with

05:35:32.080 --> 05:35:34.120
the law and

05:35:34.120 --> 05:35:36.140
also the valuation of the company

05:35:36.140 --> 05:35:38.280
so we will invite auditors

05:35:38.280 --> 05:35:40.080
and other business

05:35:40.080 --> 05:35:42.140
and we will show the financials

05:35:43.300 --> 05:35:44.380
and how much

05:35:44.380 --> 05:35:46.080
already invested in

05:35:46.080 --> 05:35:48.560
ssbc then we can evaluate

05:35:48.560 --> 05:35:50.360
it and we can

05:35:50.360 --> 05:35:52.780
calculate how much per share

05:35:54.380 --> 05:35:55.700
yung amount

05:35:56.380 --> 05:35:58.600
yung mga ssbc established

05:35:58.600 --> 05:36:01.280
as a corporation na pa

05:36:01.280 --> 05:36:03.160
hindi pa po

05:36:03.160 --> 05:36:04.440
but yes po

05:36:04.440 --> 05:36:05.960
next year pa po January

05:36:07.600 --> 05:36:09.600
partnership or

05:36:09.600 --> 05:36:09.740
soul

05:36:10.380 --> 05:36:12.560
soul po it's under

05:36:12.560 --> 05:36:12.980
my name

05:36:14.560 --> 05:36:15.220
uh

05:36:18.180 --> 05:36:20.180
yes po

05:36:20.180 --> 05:36:20.560
correct

05:36:22.960 --> 05:36:24.360
secondary

05:36:24.360 --> 05:36:24.560
license

05:36:26.320 --> 05:36:28.220
yes po

05:36:28.220 --> 05:36:28.560
correct

05:36:29.980 --> 05:36:30.940
timeline

05:36:32.560 --> 05:36:34.960
middle of next year

05:36:34.960 --> 05:36:35.360
or

05:36:36.560 --> 05:36:38.560
accounting na

05:36:39.280 --> 05:36:40.400
tapos maglalakad na

05:36:40.400 --> 05:36:42.300
ready to talk na mga jo

05:36:42.300 --> 05:36:43.700
um yung painay

05:36:46.500 --> 05:36:48.000
kasi for us

05:36:48.000 --> 05:36:49.660
to expand

05:36:50.400 --> 05:36:52.320
and magawa yung mga

05:36:52.320 --> 05:36:52.960
plans

05:36:54.240 --> 05:36:56.400
we think talaga na we need

05:36:56.400 --> 05:36:58.620
help of other people's money

05:36:58.620 --> 05:36:59.920
or investor

05:36:59.920 --> 05:37:02.200
na passionate din sa sports

05:37:02.200 --> 05:37:03.980
and we just believe

05:37:03.980 --> 05:37:06.400
in our passion and

05:37:07.200 --> 05:37:08.300
in line with our core

05:37:10.460 --> 05:37:11.220
values

05:37:12.400 --> 05:37:13.160
yes

05:37:15.460 --> 05:37:16.500
yeah we're

05:37:16.500 --> 05:37:17.460
considering it

05:37:17.460 --> 05:37:19.280
but since nga

05:37:20.300 --> 05:37:21.820
apat lang

05:37:23.580 --> 05:37:24.340
yeah

05:37:24.340 --> 05:37:26.200
actually mayon ramin gusto ko lumipat sa

05:37:26.200 --> 05:37:28.120
amin kung at least five

05:37:28.120 --> 05:37:29.700
or five to eight

05:37:30.300 --> 05:37:31.740
they're really ready to move

05:37:31.740 --> 05:37:33.840
but since it's four kulang na kulang

05:37:33.840 --> 05:37:35.000
talaga

05:37:35.000 --> 05:37:37.300
parking space

05:37:37.300 --> 05:37:39.400
very ample parking space

05:37:39.400 --> 05:37:40.760
marami tayong parking space

05:37:40.760 --> 05:37:41.980
parking space

05:37:44.200 --> 05:37:45.000
hindi kaya

05:37:47.240 --> 05:37:48.560
hindi naman

05:37:48.560 --> 05:37:50.420
well it's outside

05:37:51.000 --> 05:37:51.760
pangalawa

05:37:52.900 --> 05:37:54.420
it's really poor parking

05:37:54.420 --> 05:37:56.320
by the way may church is in Jael

05:37:56.320 --> 05:37:57.920
jesus is lord church po

05:37:57.920 --> 05:37:59.780
kay brother eddie po yes po

05:38:01.000 --> 05:38:01.920
eddie po na yes po

05:38:05.120 --> 05:38:22.720
Still active in your church. Yes po. In the men's ministry po. So I have five minutes. Yes, Brother Perry. So, for example,

05:38:22.720 --> 05:38:40.880
One million, let's say. Uh huh. Uh let's say five percent na yung sinasabi niyo. Yung five percent na yun would stop at um two years or drederecho siya?

05:38:42.160 --> 05:38:57.580
Kung hindi mo siya kukunin, drederecho siya. Kumaga pwedeng interes lang ganun. So um or pwedeng kung per month or every quarter. So depende sa atin, depende sa mapag-uusapan.

05:38:57.580 --> 05:39:15.980
But that's the ideal. Pero again, nothing yet is final. We might make a final proposal or based on what we discussed. Yes. Correct, correct. Yes, Sir Perry.

05:39:20.300 --> 05:39:30.220
Correct. Yes po. And you're allowed to sell shares based on the valuation.

05:39:35.680 --> 05:39:40.320
Thank you so much. Thank you so much for your time. Yes po. That's for sure.

05:39:45.740 --> 05:40:00.480
Yes po. Yes po. I will. That's the way I work it. Thank you so much. Um if you have a question, just message me, okay? Thank you Ram. Nice to meet you all as well. Thank you. Bye bye.

05:40:03.300 --> 05:40:06.440
Daddy, can you please connect to my internet?

05:40:07.260 --> 05:40:20.860
Oh, na-format mo na? How do you do it? I don't do it. Nakakakit ka ng, ano? MNRT, hindi nga? Marik mo namin, hindi mo na siya nilating. Ako na dito.