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!
In questa pagina del sito puoi guardare il video online Database Systems - Python Database Programming with Stored Procedure Call Example - APPFICIAL della durata di ore minuti seconda in buona qualità , che l'utente ha caricato Appficial 22 settembre 2021, condividi il link con amici e conoscenti, su youtube questo video è già stato visto 625 volte e gli è piaciuto 6 spettatori. Buona visione!