Back to Browse

How TO Create PlSql Functions With Example | Recurssion in Pl/SQL | PL-SQL Full Course Tutorial 2023

394 views
Oct 8, 2022
27:27

In this video, I have discussed about functions in pl/sql and recursive function with examples "How TO Create PlSql Functions With Example | Recurssion in Pl/SQL | PL-SQL Full Course Tutorial 2023 #recursion #plsql #oraclesql #plsqlfunction #plsqlrecurssion #plsqlbasics #plsqlprocedures #plsqlcursor #plsqlfunctions #plsqltriggers #plsqlvssql #oracleplsql #PLSQLtutorialforbeginners #PLSQLtutorialinenglish #plsqlinterview #plsqlinenglish #parnikatutorials #plsql2023 #plsqlfullcourse2023 #plsqlfullcrashcourse2023 #plsqlcrashcourse #plsqlcourse2023 01:13 - how to create function 02:11 - how to create a function in pls 03:06 - create a function 04:21 - syntax of creating function 04:49 - function should have a return statement 08:15 - create or replace function 23:14 - recursive function" A function is same as a procedure except that it returns a value. Creating a Function A standalone function is created using the CREATE FUNCTION statement. The simplified syntax for the CREATE OR REPLACE PROCEDURE statement is as follows − CREATE [OR REPLACE] FUNCTION function_name [(parameter_name [IN | OUT | IN OUT] type [, ...])] RETURN return_datatype {IS | AS} BEGIN (Function_body) END [function_name]; Where, function-name specifies the name of the function. [OR REPLACE] option allows the modification of an existing function. The optional parameter list contains name, mode and types of the parameters. IN represents the value that will be passed from outside and OUT represents the parameter that will be used to return a value outside of the procedure. The function must contain a return statement. The RETURN clause specifies the data type you are going to return from the function. function-body contains the executable part. The AS keyword is used instead of the IS keyword for creating a standalone function. CREATE OR REPLACE FUNCTION p1 RETURN number IS total number(2) := 0; BEGIN SELECT count(*) into total FROM emp; RETURN total; END; / Calling a Function While creating a function, you give a definition of what the function has to do. To use a function, you will have to call that function to perform the defined task. When a program calls a function, the program control is transferred to the called function. A called function performs the defined task and when its return statement is executed or when the last end statement is reached, it returns the program control back to the main program. DECLARE c number(2); BEGIN c := p1(); dbms_output.put_line('Total no. of Customers: ' || c); END; / A recursive function is simply one that calls itself. Create FUNCTION fact(x number) RETURN number IS f number; BEGIN IF x=0 THEN f := 1; ELSE f := x * fact(x-1); END IF; RETURN f; END; Function calling: DECLARE num number; factorial number; BEGIN num:= 6; factorial := fact(num); dbms_output.put_line(' Factorial '|| num || ' is ' || factorial); END; / Social media Links: Instagram: https://www.instagram.com/parnikatutorials/ Website: http://parnikatutorials.in/ Email id: [email protected] To get the regular updates: Telegram link: https://t.me/Parnikatutorials Facebook: https://m.facebook.com/profile.php?id=109245950811428&ref=content_filter Linkedin: https://www.linkedin.com/in/parnika-tutorials-a8a9831b2/ Pinterest: https://in.pinterest.com/parnikatutorials0892/ Playlists: Virtual Coffee with Jagadeesh: https://youtube.com/playlist?list=PL4x0v29DZ2pArePUk30o6Twn7sqnqbYCH Digital Logic Design: https://youtube.com/playlist?list=PL4x0v29DZ2pA2ZmL3dclnA-HfHkFAy0GI Computer Organization and Architecture: https://www.youtube.com/watch?v=iJN9q01OWtw&list=PL4x0v29DZ2pBRd8bChJJFtTn6ClJhKzfZ C Programming: https://www.youtube.com/watch?v=h9LtX_R-7uA&list=PL4x0v29DZ2pAIQdtRr-1zaYnqGiD_fU0M Data Structures: https://www.youtube.com/watch?v=m51BGPXdPAQ&list=PL4x0v29DZ2pCtKml6NNoBhYK4K_QnsCA_ Theory of Computation: https://www.youtube.com/watch?v=iJN9q01OWtw&list=PL4x0v29DZ2pDq-5SI9KlYxPDKdYCcmgJm Compiler Design: https://www.youtube.com/watch?v=iJN9q01OWtw&list=PL4x0v29DZ2pBsF-lPUHQ_8uRy-LbDSHIH Operating Systems: https://www.youtube.com/watch?v=vCCmq8hTC8Y&list=PL4x0v29DZ2pD6MzSQMIDSawLSKUZTFfxE Databases: https://www.youtube.com/watch?v=iJN9q01OWtw&list=PL4x0v29DZ2pCYEa9s3r5zWrFYIxGivlEC Computer Networks: https://www.youtube.com/watch?v=iJN9q01OWtw&list=PL4x0v29DZ2pBBOq-QsHtCuA53IlRxIQNm For GATE PYQs and much more explore: https://www.youtube.com/c/ParnikaTutorials/playlists

Download

1 formats

Video Formats

360pmp433.8 MB

Right-click 'Download' and select 'Save Link As' if the file opens in a new tab.

How TO Create PlSql Functions With Example | Recurssion in Pl/SQL | PL-SQL Full Course Tutorial 2023 | NatokHD