MySQL:- Stored Procedure – Simple Insert Statement w/ Identity Key

Background Let us create a simple Stored Procedure in MySQL.   Code Table department SQL Stored Procedure departmentAdd Outline Add Department Arguments Department Name ( name ) Insert Record Capture Identity Value (¬† LAST_INSERT_ID() ) Return Assigned identity value as idAssigned SQL Invoke Output Output - Department Output - Department - Last Added   Code … Continue reading MySQL:- Stored Procedure – Simple Insert Statement w/ Identity Key

MySQL – Sample – Sakila – Adding new customer record

Background Wanted to see how hard it will be to play around with the sakila MySQL Database. Objective Our objective will be to add a couple of records to the sakila.customer table. Because the table has a couple of foreign keys, we need to get a handle to valid entries in those tables, as well. … Continue reading MySQL – Sample – Sakila – Adding new customer record