I am writing some CRUD procedures, and getting nowhere. I used to develop in MySQL all the time, but moved to MS Sql and now I have forgotten more than I recall...
My table Colours has columns:
id - int autonumbering
label - varchar(50)
description - varchar(200)
reference - varchar(6)
All I'm trying to do is to put my INSERT procedure together - this should be childs play?
CREATE DEFINER=`niklouch`@`localhost` PROCEDURE `Colour_INSERT`(IN `@label` VARCHAR(50), IN `@description` VARCHAR(200), IN `@reference` VARCHAR(6))
MODIFIES SQL DATA
INSERT INTO `Colour` (`id`, `label`, `description`, `reference`) VALUES (NULL, @label, @description, @reference)
When run, it certainly inserts a new row, with a new auto-numbered ID, but label, description and reference are all NULL
CALL Colour_INSERT('Red','Deep red akin to burgundy','FF0000')
Question
Dick Montage
I am writing some CRUD procedures, and getting nowhere. I used to develop in MySQL all the time, but moved to MS Sql and now I have forgotten more than I recall...
My table Colours has columns:
id - int autonumbering
label - varchar(50)
description - varchar(200)
reference - varchar(6)
All I'm trying to do is to put my INSERT procedure together - this should be childs play?
When run, it certainly inserts a new row, with a new auto-numbered ID, but label, description and reference are all NULL
Just inserts a blank row...
WTF?
Link to comment
Share on other sites
3 answers to this question
Recommended Posts