Database Coding – Check for NULLs

Background Saw a code online and quickly knew it was not fully tested.   Preparation Outline Create Sample Table column_identity Create Table SQL Code Stack Overflow How to reset AUTO_INCREMENT in MySQL? Source Source How to reset AUTO_INCREMENT in MySQL? Question Link Answers Kim Stacks Image Code Invoke SQL   Output Output - Image Output … Continue reading Database Coding – Check for NULLs

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

Background Let us create another simple Stored Procedure in MySQL. Unlike our previous try, we will not have the luxury of a system-generated identity key.   Lineage MySQL:- Stored Procedure – Simple Insert Statement w/ Identity Key Link   Code Table department SQL Stored Procedure departmentAddIdAsIdentityNo Outline Sanitize Input Data Department If Department Name is … Continue reading MySQL:- Stored Procedure – Insert Statement w/o Identity Key

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