Execute Immediate in PL/SQL Explained with example.

Поделиться
HTML-код
  • Опубликовано: 15 сен 2024
  • Execute Immediate is mainly used to run native dynamic sql, This video takes a lay men approach to easily but precisely explain the concept using real project examples.
    #DynamicQuery #ExecuteImmediate #TechCoach

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

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

    Nice explanation sir,pls make a video on all types of hints, reverse key index, deterministic function, pipeline function , performance tuning & tricky sql interview questions.

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

      Hints and reverse key index are in my plan and you should see a video on them soon. For performance tuning I will also recommend watching my video series on partitioning.Thanks a lot for the kind words :)

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

    Hi Vivek,
    You have explained it very well please explain complete oracle sql in detail.
    Thanks in advance .

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

      Sure Kajal, I will upload more videos soon.Thanks for the kind words :)

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

    Hi bro superb explanation..every one can easily understand thank you for sharing bro..and also pls share 1).what is WHERE CURRENT OF CLAUSE,2).WHAT IS FOR UPDATE CLAUSE.and 3).what is refcursor why we using..thank you in advanced bro

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

    Awesome explanation

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

      Thanks a lot buddy for the kind words :)

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

    thanks vivek sir,,,,,could you please make videos on types/collection/array. thanks in advance

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

    We can run dml statements inside a procedure, but why its not happening with delete ??

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

    Thanks for the video... helped a lot

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

      Thanks Buddy I am glad I could help

  • @abdulmazid7615
    @abdulmazid7615 2 года назад +1

    Sir have created 24partitions of each hour table now I want to drop 20 partitions and insert data into 4 partitions in the same block using execute immediate please share your answer

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

      Created named partition so that you can easily identify and delete them

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

    nyc video but I want to know more uses of execute immediate with examples.Please upload more video on it.

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

      If you want to execute a DDL inside a procedure you need to use execute immediate, if you want to create sql dynamically based on data driven scenarios then you need to use execute immediate

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

    Create Or Replace Procedure Proc1(table_name varchar2)
    As
    Begin
    Execute Immediate 'delete from' ||table_name;
    End Proc1;
    execute Proc1('Exe_Tab2'); --when I tried to execute: execute Proc1('Exe_Tab2'); this command I am getting error that 'table or view does not exist'.. but table is already created with records.. can you please help.

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

    It's a waaaww! Vedio Thanks Sir 🙏

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

      Thanks a lot for the kind words Vicky :)

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

    Hi Vivek,
    First of all, thanks for wonderful explanation. While executing a procedure where I am passing an integer into procedure block
    Egi: exec proc1(7);...This integer is nothing but an Employee ID of a certain table name as Employee.
    And when the block statement is getting executed, it is deleting the record. PFB procedure:
    Create or replace procedure proc1(Emp_ID)
    As
    Begin
    Delete from Employee where empid=Emp_ID;
    End;
    Here Employee is table having column as empid and empname.
    As per my understanding the sql over there is dynamic one where it is accepting runtime value 7. But it is getting executed successfully without using 'Execute Immediate'
    Could you please clarify what I misunderstood?
    Appreciate all your help!!!

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

      Thanks a lot for the kind words.Dynamic sql is slightly different from what you have mentioned.Dynamic sql statements are usually used when you don't know the table name or where clause or similar stuff.

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

      Thanks for the clarification Sir!!!...I got your point...

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

      Hi Ayush I am working on this new youtube channel, It would be of immense help if you and subscribe.
      ruclips.net/channel/UCoLdaMxhfDgdgIAcRGlUvkg

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

      Done!!!!

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

    Thank you Vivek 😊

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

      +Ankush Gondane You are welcome :)

  • @ramKumar-lf7er
    @ramKumar-lf7er 2 года назад

    Can you do videos on SQL injection concept

  • @ramKumar-lf7er
    @ramKumar-lf7er 2 года назад

    Dynamic SQL how to use using class in SQL injection

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

    Will I be able to do this without execute Immediate?
    BEGIN
    FOR Row_Call IN (SELECT * FROM My_Tmp_Tbl)
    LOOP
    DELETE FROM My_Orig_Tbl WHERE user_id = Row_Call.user_id
    AND join_date = Row_Call.join_date;
    -- Some more task
    END LOOP ;
    END;

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

    Hi friend. How to use DQL statement in PL/SQL.means what about select statement

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

      They Can be used easily inside begin end section , Let me know if you need some sample code :)

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

    Can you explain Collections,Triggers and Cursors?

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

      Sure Ruchi I will work on it soon.
      I need a small help I am working on this new youtube channel and would really appreciate if you watch and subscribe to it.
      ruclips.net/video/11DK-oyRql0/видео.html

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

    Thank you. This video was helpful. However I am trying to implement a query where I want to copy the data from 1 table to another and the table names have to be provided dynamically. I am using the below query and it's throwing error as:
    'PLS-00103: Encountered the symbol "select * from " when expecting one of the following: . ( * @ % & = - + ; < / > at in is mod remainder not rem or != or ~= >=

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

      Hi Aishwarya, you are missing || before select.

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

      @@TechCoach Thanks, this worked. Also, do you have any knowledge about how to import and use this procedure in Informatica Powercenter? Just curious.

  • @mahendraeee3637
    @mahendraeee3637 2 года назад +1

    I need plsql job support can you help me

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

      I am sorry Mahendra, I am not providing any job support at the moment