I want to modify a SP in MySQL, but don't want it to crash apps currently using that SP.
The SP is: SP_CreateUserReport
Argument 1: Check4ItCode
Argument 2: PasscodeAdmin
Currently, the calling app sends something like:
But I want to add a new argument to the SP:
Argument 3: DemoUserEmail
When I do that, and do the same call, the SP will not receive the 3rd new argument and fail.
Eventually, I will update the all the calls from various apps to add the 3rd argument value, But in the meantime, I want to make that 3rd argument optional till I can update all the calling apps. And, if that value is not there, store a NULL in the table for that field.
Here is a sample of the final code I wish to use.
CREATE DEFINER=`root`@`localhost` PROCEDURE `SP_CreateUserReport`(
Check4ItCode varchar(255) ,
INSERT INTO tbl_000_010_MAIN_REPORT_INFO (
Check4ItCode as CFICode,
PasscodeAdmin AS AdminCode,
DemoUserEmail as TheDemoUserEmail
SELECT LAST_INSERT_ID() as NewReportID;