Man illustrationFlower illustration

Using Stored Procedures

Estimated reading: 1 minute 175 views
DELIMITER //
Create Procedure subjects (IN S_Subject VARCHAR(25), OUT total INT)
BEGIN
SELECT count(subject)
INTO total
FROM student_info
WHERE subject = S_subject;
END //
DELIMITER ;

Procedure

The table named “student_info”

param1 : [“1”, “STRING”, “IN”, “History”]

param2 : [“2”, “INTEGER”, “OUT”, “@total”]

  • Once the parameters are defined correctly, all we have to do is write our query. The correct usage for this query is as follows:

Stored procedure : {call subjects(?,?)}

DELIMITER //
create procedure SHOW_SUPPLIERS()
    begin
        select name, address
        from student_info;
    end//
DELIMITER ;

Procedure

The table named “student_info”

Procedure call :   call SHOW_SUPPLIERS();

  • When the above query is made, the result that will return is as follows.
  • The parameters required while designing the process in the modeler are as follows;
param1 : [“1”, “RESULTSET”, “OUT”, “”]
query sql : { call SHOW_SUPPLIERS()}
Share this Doc

Using Stored Procedures

Or copy link

CONTENTS
Chat Icon Close Icon