Oracle interview question Procedure Vs Function | ORACLE PROCEDURE VS FUNCTIONS

Поделиться
HTML-код
  • Опубликовано: 15 дек 2024

Комментарии • 165

  • @sivaveeramallu3645
    @sivaveeramallu3645 5 лет назад +13

    All the videos from Siva Academy are super.

    • @SivaAcademy
      @SivaAcademy  5 лет назад

      Welcome bro 🙏

    • @gowthamraj1750
      @gowthamraj1750 3 года назад

      @@SivaAcademy can you please explain difference between execution plan and explain plan

    • @SivaAcademy
      @SivaAcademy  3 года назад

      Sure, please stay tuned

  • @renevillalta27
    @renevillalta27 4 года назад +3

    Great Videos thanks, just pointing something, functions can be called in SQL statement so far as the function doesn't contain any formal parameter mode OUT or IN OUT

  • @vivektarab16
    @vivektarab16 5 месяцев назад

    Start
    0:34 - Difference between Procedure and Function - Procedure vs Function -
    A function should always return a value and to return information from a function will be using the return Keyword
    0:51 -
    1:08 - But in Procedure - we can have any no of return value
    So that is the reason function can return only 1 value, so may be we can return like an array or any other collection but irrespective of that we can only
    1:24 - Functions can be called from Select Statement - The Functions can be called from a Select Statement like the way we used to call the inbuilt functions, we can write our user defined functions and we can call from the Select statement,
    However Procedures cannot be called from the Select Statement.
    Mainly functions are used to implement the computational purposes, where as the procedures will be using to implement the logical data flow.
    1:47 - Autonomous Transaction - As I mentioned earlier the functions can be called from a select statement but there is a restriction in Oracle like if the function has any DML statement then we cannot call this function in the select statement
    but there is an exception to this rule - If it is in the autonomous transaction function then it can have a DML statements also.
    2:59 - Return Keyword to Return the Value
    3:51 - Now we will See Few Examples - Return in Procedure
    4:33 - Return in Function
    5:20 - How will you identify all the Function which doesnt have a Return Keyword
    5:54 - Enhancement in one more Procedure and Function in 12.1 C

  • @sagarjadhav299
    @sagarjadhav299 5 лет назад +3

    Very Good and Helpful Information Also Your teaching style is very good Sir

  • @martinsuresh5048
    @martinsuresh5048 6 лет назад +1

    very helpful information hatsoff sir

  • @kunnudev7250
    @kunnudev7250 4 года назад +1

    Great job please continue awesome videos sir

  • @premgona5587
    @premgona5587 6 лет назад +3

    RETURN keyword in procedure will take the call to the calling environment and exit from the program
    In function, RETURN will return the value and exit from the program....
    I'm not commenting as you are wrong.. I'm just extending the statement

    • @Snakism12
      @Snakism12 3 года назад

      ok... now u can go to hell

  • @sciencemaster4815
    @sciencemaster4815 Год назад

    I'm finding your videos very helpful. Thanks.

  • @prathyush1773
    @prathyush1773 4 года назад +1

    Great Siva. Thank you for your videos. Very clear explanation.

  • @sonukumar-nx8tt
    @sonukumar-nx8tt 2 года назад

    Very helpful..thanks for amazing video

  • @abhisheknegi8053
    @abhisheknegi8053 4 года назад

    All your videos are very nice easy to understand and having sense.

  • @rainbowclubkerala2685
    @rainbowclubkerala2685 4 года назад

    It's wonderful.. Nicely explaining everything... Thankuu

  • @akware977
    @akware977 5 лет назад +1

    Thank you so much for the video and sharing knowledge.....

  • @bharathipandian45
    @bharathipandian45 3 года назад

    Siva, a doubt. If fiction without keyword can be compiled. But we can't use it in both select and inside any other objects like proc function or in any java code?

  • @sreecreativy
    @sreecreativy 16 дней назад

    Sir returning keyword in the procedure is not working for me ,,I am using 19 version of Oracle plsql

  • @premgona5587
    @premgona5587 6 лет назад +2

    Please note from 11g onwards, we can use mixed notations when we execute the function.
    Mixed notation includes, positional notation and named notation.
    For example if you have a function called FF1 with an IN parameter then at the time of execution we can do as below.
    SELECT FF1(IP_1 =>5) FROM DUAL;
    SELECT FF1(5) FROM DUAL;

  • @sheikabdullah1494
    @sheikabdullah1494 3 года назад

    Sir ...why we go for functions instead of a procedure ...can u pls explain this !?

  • @gowthamraj1750
    @gowthamraj1750 3 года назад

    Can you please explain difference between execution plan and explain plan

  • @sankareeswaran
    @sankareeswaran 4 года назад

    Nice explanation. I have 12plus years experience. But they asked this question.

    • @SivaAcademy
      @SivaAcademy  4 года назад

      yeah, this happens sometimes :-)

  • @akashsoni6419
    @akashsoni6419 4 года назад +2

    Hello shiva, your vedios are really awesome,
    Could you please make a vedio on deterministic Function and pipelines functions with real time examples.
    Thanks in advance.

    • @SivaAcademy
      @SivaAcademy  4 года назад

      Sure Akash, Please stay tuned.

  • @digv0008
    @digv0008 3 года назад

    Hi Siva,
    Where can I get the scripts used in all these videos?
    Thank you.

  • @shyamkumardhamode4475
    @shyamkumardhamode4475 4 года назад

    Primary key does not have null and duplicates but foreign key does have why?

  • @ankursrivastava5148
    @ankursrivastava5148 4 года назад

    Can you please explain 4 th point with example in case of function?

  • @swamivivekananda-cyclonicm8781
    @swamivivekananda-cyclonicm8781 2 года назад

    So unique and insightful

  • @VijayKumar-eq2te
    @VijayKumar-eq2te 3 года назад

    Which book is better for reading for sql plsql.

  • @ngundre
    @ngundre 4 года назад

    Here you have mentioned functions having dml statement can be called from sql if it's autonomous transaction. Can you explain what is autonomous transaction functions. As per my information, are you referring pragma autonomous declaration in function. Please explain this point how we can call function having dml in sql

    • @SivaAcademy
      @SivaAcademy  4 года назад

      Please look into this video ruclips.net/video/yyRM-p2xfZc/видео.html

  • @vijaydubey1734
    @vijaydubey1734 3 года назад

    Very helpful Siva,🙏 many thanks

  • @harishas1224
    @harishas1224 Год назад

    Hello
    I’m looking for the starting videos bcz now I’m learning to start from beginning so plz let me know which one is the starting video in all the video like series numbers.

    • @SivaAcademy
      @SivaAcademy  Год назад

      Eevery video covers a specific point with respect to interview, you can watch anything in any order, however if you follow the Playlist order, it would be easy for understanding

  • @biswanath4554
    @biswanath4554 3 года назад

    Autonomous transaction function, can you show us some examples

  • @purushothamanthillaw.sa.pi8483
    @purushothamanthillaw.sa.pi8483 5 лет назад +1

    very clear post , thanks siva.

  • @manishaar3154
    @manishaar3154 Год назад

    Can we fetch the last 3 records inserted without having an identity column nor date column ?

    • @Crazy-Trainings
      @Crazy-Trainings 5 месяцев назад

      Yes u can
      select top(select count(*) from tabl) from tab1
      minus
      select top(select count(*) from tab1)-3 from tab1;

  • @poonamdhamane7394
    @poonamdhamane7394 3 месяца назад

    Please make video on role for Oracle

  • @abhisheknegi8053
    @abhisheknegi8053 4 года назад

    Hello please share the link regarding pragma autonomous transaction

    • @SivaAcademy
      @SivaAcademy  4 года назад

      Yet to post a video, please stay tuned

  • @humayunhimu6045
    @humayunhimu6045 Год назад

    Can u please tell what is level and connect by

  • @MaheshkumarRevalmath
    @MaheshkumarRevalmath 3 года назад

    Hi,
    Could you pl share a video on the similarities or difference between Loops and Cursors in PL/SQL?

  • @SACHINRATHOD-cs7zs
    @SACHINRATHOD-cs7zs 2 года назад

    How can we add amount from last rows and give total output in current row?

    • @SivaAcademy
      @SivaAcademy  2 года назад

      Please post sample data and expected output

  • @vivektarab1959
    @vivektarab1959 25 дней назад

    3:47 - Start
    6:00

  • @kaththikarthi878
    @kaththikarthi878 2 года назад

    Sir, why we are using function. Because all operation should be done with procedure. But why using function???????
    Pls tell me bro

  • @reinecj672
    @reinecj672 5 лет назад

    Can we call procedure inside a function and calling function inside a procedure?

    • @SivaAcademy
      @SivaAcademy  5 лет назад

      Yes you can call both way, however there are few limitations, will explain with example soon, please stay tuned

  • @naseemashaik6457
    @naseemashaik6457 2 года назад

    Hi Shiva
    I received this question from my interviewer
    Q: We can perform all actions inside the procedures then what is the need of functions?

    • @SivaAcademy
      @SivaAcademy  2 года назад

      Procedure cannot be called in select Statement. However function can be used in select Statement.

  • @raju26067
    @raju26067 6 лет назад

    Can we call or use procedure inside the function ?one example please?

    • @SivaAcademy
      @SivaAcademy  6 лет назад

      Yes you can call, I will post a video on this question.
      In the mean time, you can read my answer for your question here.
      www.quora.com/Is-it-possible-to-define-a-function-inside-the-procedure-definition/answer/Jeevan-139
      www.quora.com/Is-it-possible-to-define-a-procedure-within-a-function-definition-and-vice-versa/answer/Jeevan-139
      Thanks,
      Siva Jeevan

  • @shaphikmulla4149
    @shaphikmulla4149 5 лет назад +1

    Thank you sir ...you are awesome

    • @SivaAcademy
      @SivaAcademy  4 года назад

      It's my pleasure,Thank you so much :-)

  • @thiru601mbt6
    @thiru601mbt6 2 года назад

    Can we use function inside stored procedure? pls share video on this bro

    • @SivaAcademy
      @SivaAcademy  2 года назад

      Yes, you can use function within procedure

  • @umajeeva302
    @umajeeva302 2 года назад

    SQL ful ah step step ah Tamil iruka sir unka vidro

  • @muralisethi
    @muralisethi 5 лет назад

    Dear Siva, thanks for posting such valuable concepts.
    Can we have out parameters in function?

    • @SivaAcademy
      @SivaAcademy  5 лет назад

      Yes you can, please look into this video ruclips.net/video/PyJ5Zwfb7WY/видео.html

  • @mayurhajare1596
    @mayurhajare1596 4 года назад

    I have gone this question many time in first technical round

  • @karthikeyanviper
    @karthikeyanviper 4 года назад

    Pls post video related procedure and function in with clause

    • @SivaAcademy
      @SivaAcademy  4 года назад

      Its already available, please look into this video ruclips.net/video/rJuRWv7k-zo/видео.html

  • @omkardl678
    @omkardl678 3 года назад

    Could you please explain the high level water mark topic bro

  • @shaikrasheed2861
    @shaikrasheed2861 5 лет назад

    Is plsql pass by value,pass by reference ??
    For example java is allowing pass by value??

    • @SivaAcademy
      @SivaAcademy  5 лет назад +1

      @Shaik, Ya, in PLSQL too, we can have pass by value & reference, By default all the parameters passed to PLSQL code are pass by value, if you specify "NOCOPY" keyword, it becomes pass by reference, but there is little more to understand about NOCOPY. I will cover in detail about NOCOPY and its effects in some other video. Thanks, Siva

    • @shaikrasheed2861
      @shaikrasheed2861 5 лет назад

      Thank you sir

  • @ramchinthakayala2092
    @ramchinthakayala2092 5 лет назад

    hi,
    how to display 1 to 10 numbers in a single row (horizontally). Kindly let me know??

    • @SivaAcademy
      @SivaAcademy  5 лет назад

      Displaying as a single string of comma separated values like 1,2,3,4,5,.... Is quite straight forward, however displaying in ten individual column is bit complex.... Please let me know your requirement

    • @srikanthk.chandiran343
      @srikanthk.chandiran343 5 лет назад +2

      Please try this
      SELECT LISTAGG(LEVEL, ',') WITHIN
      GROUP(
      ORDER BY LEVEL) EXPECTED_OUTPUT
      FROM DUAL
      CONNECT BY LEVEL

  • @lekhyadivya2626
    @lekhyadivya2626 4 года назад

    Please also make a video on pipelined and parallel functions...

  • @ravipatisrikanth8331
    @ravipatisrikanth8331 4 года назад

    What is the autonomous transaction functions

    • @SivaAcademy
      @SivaAcademy  4 года назад

      Please look into this video
      ruclips.net/video/OK7KA99plXQ/видео.html
      ruclips.net/video/R4dyvrVC9t0/видео.html

  • @divyabaireddy6271
    @divyabaireddy6271 5 лет назад

    Please explain about returning multiple values from a function

    • @SivaAcademy
      @SivaAcademy  5 лет назад

      Already posted, please look into this video ruclips.net/video/PyJ5Zwfb7WY/видео.html

    • @nagaswamymp5388
      @nagaswamymp5388 5 лет назад

      return refcursor

    • @shintojoy317
      @shintojoy317 4 года назад

      1. You can use multiple OUT parameters (Scalar / Complex)
      2. You can RETURN REF CURSOR
      3. You can RETURN Complex datatypes (Collections, Records, Object Types)

  • @vrushalisonawane1238
    @vrushalisonawane1238 4 года назад

    Sir, can we call the procedure in select statment?

    • @SivaAcademy
      @SivaAcademy  4 года назад

      No, you cannot call procedure in select statement however you can call via function, also please look into this ruclips.net/video/rJuRWv7k-zo/видео.html

    • @SivaAcademy
      @SivaAcademy  4 года назад

      No, procedure cannot be called from select statement, however you can use in with clause, and can be called via function, you can look into this ruclips.net/video/rJuRWv7k-zo/видео.html

  • @pritikumari5616
    @pritikumari5616 5 лет назад

    please let us know that how to optimize function?

    • @SivaAcademy
      @SivaAcademy  5 лет назад

      Are you looking to tune PLSQL code inside function?

    • @pritikumari5616
      @pritikumari5616 5 лет назад

      @@SivaAcademy yes by which performance of function will fast..

  • @hemantakumar3652
    @hemantakumar3652 3 года назад

    How to optimize a procedure in Oracle if the procedure having 1500 lines codes? Can u make a video ?

    • @SivaAcademy
      @SivaAcademy  3 года назад

      Please look into this video,
      ruclips.net/video/G67gaP79htE/видео.html

  • @bblingamoorthy
    @bblingamoorthy 4 года назад

    Thanks Siva, could you help me to clarify the following question that was asked during one of my interview discussions ?
    When a given task can be completed just by using a Procedure, what is use of doing the same task using Package ?

    • @SivaAcademy
      @SivaAcademy  4 года назад +1

      Will post a video on advantages of writing with in packages soon, please stay tuned

    • @bblingamoorthy
      @bblingamoorthy 4 года назад

      @@SivaAcademy Thank you very much for your response Siva. Please add the link once posted

    • @SivaAcademy
      @SivaAcademy  4 года назад +2

      Please look into this video
      ruclips.net/video/Mje8pEtVe5I/видео.html

    • @bblingamoorthy
      @bblingamoorthy 4 года назад +1

      @@SivaAcademy Thank you so much for your effort and timely response. Let me watch.

    • @SivaAcademy
      @SivaAcademy  4 года назад

      Welcome 👍💐

  • @praveenamarghade1383
    @praveenamarghade1383 4 года назад +2

    Thank you for this nice video.
    I have one query, Can funtion contains DDL statement?

    • @SivaAcademy
      @SivaAcademy  4 года назад

      Welcome, yes, you can have, however there are few restrictions, for more details please look into this video
      ruclips.net/video/yyRM-p2xfZc/видео.html
      ruclips.net/video/CGLWDytoUeE/видео.html

  • @udbhavdwivedi410
    @udbhavdwivedi410 2 года назад

    Why do we use function when we have Procedure?

    • @SivaAcademy
      @SivaAcademy  2 года назад

      procedure cannot be called directly in SQL

  • @atulraut6212
    @atulraut6212 3 года назад

    Hi Siva do you Take online Training for SQL Plsql

    • @SivaAcademy
      @SivaAcademy  3 года назад

      Please drop me mail at siva.k.academy@gmail.com

  • @manoranjanray8181
    @manoranjanray8181 4 года назад

    Siva, please create a detailed video on debugging

    • @SivaAcademy
      @SivaAcademy  4 года назад +1

      Sure please stay tuned 👍

  • @mlipina5324
    @mlipina5324 5 лет назад

    Very nice explanations ,Please add some extra volume.

    • @SivaAcademy
      @SivaAcademy  5 лет назад

      @m Lipina, Thanks for your comments, In the recent videos volume has been raised. I will take care in upcoming videos.
      Regards,Siva.

  • @venkatasubbareddyonteru4581
    @venkatasubbareddyonteru4581 3 года назад

    Video is not playing

  • @srikanthuyyala3811
    @srikanthuyyala3811 4 года назад

    Please explain joins

  • @brenthawkins5097
    @brenthawkins5097 4 года назад

    Fun fact. The creator is actually from Decatur, Georgia. He has to use this accent to get views.........just kidding. Great vid. Thanks alot.

    • @SivaAcademy
      @SivaAcademy  4 года назад

      😀😀 thanks for your comments

  • @suyogthakare828
    @suyogthakare828 5 лет назад

    Sir how can be private procedure call in the package

    • @SivaAcademy
      @SivaAcademy  5 лет назад

      @Suyog, Private procedure/functions are the one that is declared&defined only within the package body, These procedures are not declared in the spec, hence these private procedures cannot be accessed by anyone,. Only with in the body of the package, the other package members ( ie., ther other procedure or function) can call the private procedures. May be I will explain with an example in the next subscriber comment replay video with an example for everyone's benefit. Please stay tuned.

    • @suyogthakare828
      @suyogthakare828 5 лет назад

      @@SivaAcademy thank you sir it really hepful for me. I will be waiting for the video

  • @raghavendranramachari488
    @raghavendranramachari488 3 года назад

    Thank you for the video..very useful...But the audio is very low....

    • @SivaAcademy
      @SivaAcademy  3 года назад

      Welcome, I hope recent videos are fine

  • @SuReshMiStry1
    @SuReshMiStry1 2 года назад

    High quality video not available

  • @bharathipandian45
    @bharathipandian45 4 года назад

    Hi siva, can you help me to crack production support interview questions

    • @SivaAcademy
      @SivaAcademy  4 года назад

      Please post your questions, will get it addressed if not posted already

    • @bharathipandian45
      @bharathipandian45 4 года назад

      @@SivaAcademy ok siva a help. Can you post production support related interview questions. Am a production support engineer.

  • @Ganeshay-09
    @Ganeshay-09 8 месяцев назад

    With
    function get_country_name1 (p_country_id varchar2) return varchar2 as
    l_country_name hr.countries.country_name%type;
    Begin
    select country_name into l_country_name from hr.countries where country_id = p_country_id;
    return l_country_name;
    End get_country_name1;
    N1 as (
    select E.FIRST_NAME, E.LAST_NAME, E.SALARY, L.country_id
    from hr.employees E, hr.departments D, hr.locations L
    where E.DEPARTMENT_ID = 90
    and E.DEPARTMENT_ID = D.DEPARTMENT_ID and D.LOCATION_ID = L.LOCATION_ID
    ) select N1.*, get_country_name1(N1.country_id) country_name from N1; --------------- like this we can call the function using with clause in function

  • @vasubabugunda7947
    @vasubabugunda7947 4 года назад

    Super explanation sir

  • @Prasanna2win
    @Prasanna2win 3 года назад

    thank u sivagaru

  • @rajt5218
    @rajt5218 3 года назад

    Helpful sir

  • @sgnaneswari2902
    @sgnaneswari2902 3 года назад

    Super explaination

  • @venkatapathiuppalapati9673
    @venkatapathiuppalapati9673 3 года назад

    Nice videos air

  • @alokmaurya7493
    @alokmaurya7493 3 года назад

    Siva Academy is Super Siva Academy ❤️

  • @snehadubey2442
    @snehadubey2442 4 года назад

    Well explained

  • @sr2568
    @sr2568 3 года назад

    Please bro,do video series on MACRO

    • @SivaAcademy
      @SivaAcademy  3 года назад +1

      Yes bro, work in progress, will be added soon, please stay tuned

  • @pradeepverma8277
    @pradeepverma8277 4 года назад

    nice video

  • @umajeeva302
    @umajeeva302 2 года назад

    Sir Tamil video iruka

    • @SivaAcademy
      @SivaAcademy  2 года назад

      As of now illa bro

    • @umajeeva302
      @umajeeva302 2 года назад

      @@SivaAcademy Tamil irundha use ful ah irukum

    • @SivaAcademy
      @SivaAcademy  2 года назад

      Hmm OK bro, let me try

  • @gsraj511
    @gsraj511 2 года назад

    Thanks Siva..

  • @ramanhasan9398
    @ramanhasan9398 2 года назад

    Thank you!!

  • @bhanupratap2921
    @bhanupratap2921 4 года назад

    Voice is too low here ..otherwise videos are good