Summary
Keywords
Full Transcript
MySQL procedural SQL includes stored procedures, which are stored in the database and can be called by python code with the cursor.callproc() method. The cursor.callproc() method has 2 parameters: the stored procedure name, and a tuple of input that holds the value for each parameter of the stored procedure. An output tuple is returned which has one value for each stored procedure parameter. IN, OUT, or INOUT, in the sttored procedure parameters indicate whether the parameter is for input, output, or both. If you use OUT, the input tuples values are ignored. If you use IN, the value of the output tuple is the input value. In the code shown: movie_count counts the number of R movies. movie_data contains the rating we are trying count and a 0 placeholder for the count parameter. callproc() calls the stored procedure RMovieCount with the input tuple movie_data and returns the output tuple to result. result[1] is the second entry of the result tuple. Subscribe to Appficial for more programming videos coming soon. Also, don't forget to click LIKE and comment on the video if it helped you out!
