campkev 0 Posting Pro in Training

ok, here is the script I ran to create the stored procedure

SET QUOTED_IDENTIFIER ON 
GO
SET ANSI_NULLS ON 
GO




CREATE PROCEDURE [insertFunction] (@Id [int], @class [nvarchar], @type [nvarchar], @name [nvarchar]) AS 

declare @classID [int]
select @classID = tblClass.ID from tblClass where tblClass.Name = @class



INSERT INTO tblFunction
	([ID],[Name],[ReturnType],[Class])
VALUES 
	(@Id,@name,@type,@classID)
GO
SET QUOTED_IDENTIFIER OFF 
GO
SET ANSI_NULLS ON 
GO

but when I run it I keep getting
Cannot insert the value NULL into column 'Class', table 'documentation.dbo.tblFunction'; column does not allow nulls. INSERT fails.
The statement has been terminated.

when i run the procedure substituting values for the variables, it works fine.

Any ideas?