Oracle PL/SQL Stored Procedures and Functions

  Рет қаралды 13,560

Clint Tuttle

Clint Tuttle

Күн бұрын

Пікірлер: 6
@jakeg9711
@jakeg9711 2 жыл бұрын
Hi Clint, thank you for the video. It is very insightful, I'm just wondering how would you do this if you wanted to have the SPROC insert in to multiple tables? Taking the example in the video, e.g. insert in to invoice & supplier table? Thanks!
@clinttuttle
@clinttuttle 2 жыл бұрын
Depending on the use case, you may have an application screen that uses a screen to create the vendor using an "insert vendor" SPROC and then have a separate SPROC for inserting invoice. It's also possible that an application has a screen to create vendor and invoice at once which sounds like what you're describing. Assuming you have the required fields you need to create a vendor and invoice, you could put all of that into a single SPROC. You could write a SPROC that takes in the required parameters for a vendor and invoice and then write two separate inserts in the SPROC's main body (one for vendor and one for invoice) and then include a Commit; after these two inserts. If there is an error in either insert you can have the Exception block include a ROLLBACK; statement to reverse the changes. That's how you can manage the transaction. Hope this helps!
@craigronald2717
@craigronald2717 2 жыл бұрын
Hi Thanks for the video. But i have a question. Let's suppose I've already created a function and now i want to get output of that code. How will i do it. Is it possible to get output by selecting the functions from left panel and then run it and get the output? I tried but it ask for input values .. I just don't want to run the code again and again to get the output
@clinttuttle
@clinttuttle 2 жыл бұрын
Not sure you can run the function from the lefthand menu like you describe. The way I think of user-defined functions is to use them like I would any standard function like SUM or AVG which would be used in a SELECT commonly. So could you try selecting your function from the DUAL table? Try this: Select YourFunction(hardcode a value to pass in) from Dual;
@bartolomedelascasas3447
@bartolomedelascasas3447 3 жыл бұрын
Hello thanks for the video, I have an exercise where I have to do the following: Prepare a stored procedure that verifies the Reimbursement request status and changes the status from Set pay to Paid and updates the Payment date to the current date. The stored procedure MUST update the referred two columns in the REIMBURSEMENTREQUEST table. Do you think this video can help me with that exercise?
@clinttuttle
@clinttuttle 3 жыл бұрын
This will help you setup the structure of a stored proc but sounds like you may need to know how to select into a variable and manage logical flow with an if statement. If this video doesn’t cover what you need I have one more on the basics of PL/SQL syntax that can show you that stuff. Happy coding!
Stored Procedures in MySQL | Advanced MySQL Series
12:37
Alex The Analyst
Рет қаралды 78 М.
The evil clown plays a prank on the angel
00:39
超人夫妇
Рет қаралды 53 МЛН
Tuna 🍣 ​⁠@patrickzeinali ​⁠@ChefRush
00:48
albert_cancook
Рет қаралды 148 МЛН
Сестра обхитрила!
00:17
Victoria Portfolio
Рет қаралды 958 М.
Stored Procedures in PL/SQL | Oracle PL/SQL Tutorial Videos | Mr.Vijay Kumar
18:54
Complete Snowflake SQL Scripting For Stored Procedure | Ch-01
16:56
Data Engineering Simplified
Рет қаралды 19 М.
I Helped 2,000 People Walk Again
15:31
MrBeast
Рет қаралды 23 МЛН
PL/SQL Introduction
1:07:38
Clint Tuttle
Рет қаралды 1,9 М.
Stored procedures in sql server   Part 18
20:11
kudvenkat
Рет қаралды 1,5 МЛН
SQL Indexes Explained in 20 Minutes
19:31
developedbyed
Рет қаралды 14 М.
Oracle - PL/SQL - Creating Procedure
14:54
TutorialsPoint
Рет қаралды 103 М.
The evil clown plays a prank on the angel
00:39
超人夫妇
Рет қаралды 53 МЛН