How To Create And Call A Stored Procedure In PostgreSQL Using pgAdmin4 || Procedure In PostgreSQL

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

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

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

    *Please help me get that beautiful RUclips Silver button. Do subscribe to the channel if my video was helpful.* ❤

  • @Knowledge360Channel
    @Knowledge360Channel  5 месяцев назад +1

    *Only 3.9% of viewers are subscribing to my channel.* 😓
    *Please Like, Comment, and Subscribe to my channel.* ❤

  • @julichinwakamoto
    @julichinwakamoto Год назад +2

    Very easy to understand. Kudos to you

    • @Knowledge360Channel
      @Knowledge360Channel  Год назад +1

      You're welcome 🤗

    • @julichinwakamoto
      @julichinwakamoto Год назад +1

      @@Knowledge360Channel do you have other video of store procedure

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

      @@julichinwakamoto Yes, please visit my channel page, you will get plenty of examples, also browse through playlists.

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

      *Please help me get that beautiful RUclips Silver button. Do subscribe to the channel if my video was helpful.* ❤

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

    Wow very well done and well explained.

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

    This one helped me a lot.

  • @OUVIR.INGLES
    @OUVIR.INGLES Год назад +1

    Thanks, nice explanation

    • @Knowledge360Channel
      @Knowledge360Channel  Год назад +1

      You're welcome 😊..plz subscribe to my channel to support me

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

    Much helpful video.

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

    It was exactly what I was looking for. Now if possible please show us how to call that Procedure from a Windows forms using C# code. Iam suscribed to your channel and soon I will check every video you have to learn much more from you.

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

      As soon as possible

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

      @@Knowledge360Channel hey dude. Show us how to make a backup from a windows form event button or method using postgres and how we can share that database over Lan please. It's all I ask in this life 😐

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

    thank you

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

      You're welcome 😊... please subscribe my channel to get updates.

  • @chitrangsharma
    @chitrangsharma 3 года назад +3

    Nice very informative.
    I have one question can we use this to make user defined tables and can we use this method to fetch all the tables inside database.?

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

    Very clear. Thank you

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

    Hi! It was really helpful. Thanks a lot

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

    wow...amazing

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

    good job, Thank you

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

    Great video 📹👍

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

    Akram can we return query or use return in store procedure like in function

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

    Great

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

    good one

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

    Very helpful.. If possible give some more example.. Thanks

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

    Hi, I do not understand the part where you write VALUES($1,$2) - why did you use $1 and $2? What does this mean?

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

      It's a great feature of mentioning the parameter position instead of writing the parameter names.

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

      In place of that, I can also write the parameter names.

    • @hendrasdrtube
      @hendrasdrtube Год назад +1

      @@Knowledge360Channel does pgsql support parameter names in procedure like sql server or oracle ?

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

      Yes, it works the same as other databases PLSQL languages

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

      @@hendrasdrtube Here's an example of that you are asking.
      ruclips.net/video/zUFgqxQYmFI/видео.html

  • @iamsherk2605
    @iamsherk2605 6 месяцев назад +1

    Why is it so easy but our professor gives the most complex exercises, given that we're total beginners? 😭

    • @Knowledge360Channel
      @Knowledge360Channel  6 месяцев назад

      Ask your professor to follow my channel. 😂😂😂😂
      Thanks for the appreciation 😊❤️

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

      *Please help me get that beautiful RUclips Silver button. Do subscribe to the channel if my video was helpful.* ❤

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

    Subscribe My Channel to get the updates of the videos, or visit the PostgreSQL playlist to learn more on PostgreSQL.

  • @bhargavimopuru8576
    @bhargavimopuru8576 Год назад +1

    where we can check store procedures in left side menu

    • @Knowledge360Channel
      @Knowledge360Channel  Год назад +1

      Browse to Databases/DatabaseName/Schemas/YourSchemaName/Procedures

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

    Akram can you come up with new videos on trigger , cursor indexes with examples

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

    Table valued parameters to procedure with (Try- Catch) and error Handle in PostgreSQL

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

    How can I create sp in Postgres to truncate 8 or more tables every day so that we can insert new data? Also, few tables have FKs

  • @gauriagarkhedkar5611
    @gauriagarkhedkar5611 Год назад +1

    Hi Akram,
    Can you please explain how to call a stored procedure from another stored procedure in postgreSQL? Tried with "call" , but it is giving error.
    Thanks in advance.

    • @Knowledge360Channel
      @Knowledge360Channel  Год назад +1

      Just call like this,
      NewProc();
      It will execute the procedure.

    • @gauriagarkhedkar5611
      @gauriagarkhedkar5611 Год назад +1

      @@Knowledge360Channel syntax error when did this. It is looking for the keyword "call"..

    • @Knowledge360Channel
      @Knowledge360Channel  Год назад +1

      @@gauriagarkhedkar5611 Okay, I will check and let you know. Can you please share the procedure on my email?

    • @gauriagarkhedkar5611
      @gauriagarkhedkar5611 Год назад +1

      @@Knowledge360Channel sure. Thanks for responding.

    • @Knowledge360Channel
      @Knowledge360Channel  Год назад +1

      I have just uploaded a video for this issue. Please check this out.
      ruclips.net/video/jAjQDRunt5U/видео.html

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

    please upload your video with higher voice

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

    here is my question.i am creating a procedure but error comes NOTICE: table "tempunitsbooked" does not exist, skipping
    ERROR: query has no destination for result data
    HINT: If you want to discard the results of a SELECT, use PERFORM instead.
    CONTEXT: PL/pgSQL function degams.sp_report_unitsbnastatistics_alloted_details(integer,integer,timestamp without time zone,numeric,text) line 21 at SQL statement
    SQL state: 42601
    procedure is -------
    CREATE OR REPLACE PROCEDURE degams.sp_report_unitsbnastatistics_alloted_details(
    u_ga_id integer,
    u_ba_id integer,
    u_date timestamp without time zone,
    INOUT rtn_unit_type numeric,
    INOUT rtn_unit_desc text)
    LANGUAGE 'plpgsql'
    AS $BODY$
    Declare no_of_rooms_Available int;
    --begin try
    begin
    --set no_of_rooms_available=
    select sum(no_units_vacant) into no_of_rooms_available from degams.getvacantunitcount
    where ga_id=u_ga_id and ba_id=u_ba_id and dateval= u_Date;
    if no_of_rooms_Available=0 then

    select count(a.unit_type_id) vacant,unit_type_m.unit_type_desc as type
    from degams.GUEST_ACCOM_UNIT_M a ,
    degams.unit_type_m where WHETHER_ONLINE = 'Y' and unit_quota'EQ' and ga_id=u_ga_id
    and ba_id=u_ba_id
    and a.unit_type_id=unit_type_m.unit_type_id
    group by unit_type_m.unit_type_desc having count(*)>=1;
    rtn_unit_type := vacant;
    rtn_unit_desc := type;

    else

    select count(a.unit_type_id) vacant,unit_type_m.unit_type_desc as type from
    degams.GUEST_ACCOM_UNIT_M a ,
    degams.unit_type_m
    where WHETHER_ONLINE = 'Y' and unit_quota'EQ' and ga_id=u_ga_id and ba_id=u_ba_id
    and a.unit_type_id=unit_type_m.unit_type_id and exists(select br_id
    from degams.allotments_vu
    where u_Date< booking_upto and u_Date >=booking_from and unit_id=a.unit_id and ga_id=u_ga_id)
    group by unit_type_m.unit_type_desc having count(*)>=1;
    end if;
    get diagnostics no_of_rooms_Available =row_count;
    rtn_unit_type := vacant;
    rtn_unit_desc := type;


    end ;
    $BODY$;

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

      Okay I will check and resend you

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

      I have created it, didn't get any error. Will you connect to me via mail to solve the issue at your side? Here is my mail knowledge.360.knowledge@gmail.om

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

      @@Knowledge360Channel procedure created smoothly but did'nt get result from it

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

      Will you show me how you are calling it?

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

      @@Knowledge360Channel call degams.sp_report_unitsbnastatistics_alloted_details('13','1','2020-10-05',NULL,NULL)

  • @rkminiblogs4107
    @rkminiblogs4107 7 месяцев назад +1

    How to create procedures for select querry

    • @Knowledge360Channel
      @Knowledge360Channel  7 месяцев назад

      Will make a video on it. Subscribe the channel to get updates.

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

      *Please help me get that beautiful RUclips Silver button. Do subscribe to the channel if my video was helpful.* ❤

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

    Hi, can you plz explain postgresql store procedure for select record from a table

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

      Okay I will explain it. Thank you bro

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

      Sorry bro, That's not possible, we need to do it through function only. If you want to return a table, create a stored function and return table as I have done in previous video.

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

    does postgresql 9.6.10 supports procedure

  • @sergeyvasilenko7641
    @sergeyvasilenko7641 3 года назад +2

    Спасибо МУЖИК

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

    how to call select statement in store procedure.?
    for example: select * from Table1

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

      I am planning to make video on it.

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

      @@Knowledge360Channel ok thank you..mean while just give idea how to call.. because tomorrow I want to create it.

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

      Search for SELECT INTO statement in PostgreSQL Procedure. I hope you will get it.

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

      @@Knowledge360Channel ok let me check

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

      @@Knowledge360Channel thanks

  • @IrinaMaiaPÉrezGribnicow
    @IrinaMaiaPÉrezGribnicow 9 месяцев назад +1

    whats plpsql?

    • @Knowledge360Channel
      @Knowledge360Channel  9 месяцев назад

      PLpgSQL is the procedural language of PostgreSQL, just like PLSQL of Oracle

    • @IrinaMaiaPÉrezGribnicow
      @IrinaMaiaPÉrezGribnicow 9 месяцев назад

      oh ty! @@Knowledge360Channel

    • @IrinaMaiaPÉrezGribnicow
      @IrinaMaiaPÉrezGribnicow 9 месяцев назад

      sorry btw, i wanted to ask you, how could i do if i need to write a script that can create a db and its tables?? the only thing im getting is that you cant create a db inside a function or transaction, so i dont know how to do this@@Knowledge360Channel

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

      *Please help me get that beautiful RUclips Silver button. Do subscribe to the channel if my video was helpful.* ❤

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

    If else in stored procedure

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

      I didn't get your question

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

      @@Knowledge360Channel how to use if else in sp and also how about return value

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

      Okay, I will make a video on this within a day. Please subscribe to get the notification

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

      @@Knowledge360Channel is there upsert option in postgres stored procedure... i need to select and insert into table in same stored procedure

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

    damn you have to use public.the_name_of_your_table otherwise it won't work i get it now thanks so much

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

      You're welcome 🤗... Actually it's not necessary to be public.tablename. It depends on grants, owner and all...for demonstration I have used public schema here.

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

    Thank you

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

    Great