I've created a stored procedure in MySQL to help debug something, however when i call the stored procedure it inserts NULL values into my table for all columns
Table
CREATE TABLE `EncryptionDebug` (
`ObservedValue` mediumtext COLLATE utf8_unicode_ci,
`PublicKey` mediumtext COLLATE utf8_unicode_ci
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
Stored procedure
DELIMITER //
CREATE PROCEDURE `EncryptionDebug`(IN `ObservedValue` MEDIUMTEXT, IN `PublicKey` MEDIUMTEXT)
MODIFIES SQL DATA
BEGIN
DECLARE `ObservedValue` MEDIUMTEXT;
DECLARE `PublicKey` MEDIUMTEXT;
INSERT INTO `EncryptionDebug` (`ObservedValue`,`PublicKey`) VALUES (ObservedValue,PublicKey);
END//
DELIMITER ;
Calling the procedure like so
CALL EncryptionDebug('test','test');
Returns NULL for both columns when i SELECT * FROM EncryptionDebug
Thanks
From the documentation:
One option to try:
SQL Fiddle demo
Recommendation: Avoid naming parameters and variables as columns of your tables, here the cause: SQL Fiddle.