View Single Post
  #3 (permalink)  
Old March 20th, 2006, 01:55 PM
kshort kshort is offline
Registered User
 
Join Date: Mar 2006
Location: , , United Kingdom.
Posts: 5
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Doh!

Sorry, that was a copy & paste mistake. I've had @ERR declared as an output var after the @lID, and using DECLARE @ERR INT in the sp itself.

Neither works.

Oddly this is only a problem for the DELETE stored procedure. The select/update/insert all work fine & return @ERR. The delete sp doesn't. Depending on whether I have @ERR declared in the stored procedure and/or in the delete parameters for the datasource

For example the following sp work fine & return the @ERR. I don't understand why the delete one doesn't. :(


CREATE PROCEDURE [dbo].[usp_getLearningAreas]
AS
DECLARE @ERR INT
SELECT learningAreaName as lName, learningAreaID as lID FROM learningAreas ORDER BY learningAreaName
SET @ERR=@@ERROR
RETURN @ERR
GO

CREATE PROCEDURE [dbo].[usp_insertLearningArea]
(
@lName nvarchar(50)
)
AS
DECLARE @ERR INT
INSERT INTO [learningAreas] ([learningAreaName]) VALUES (@lName)
SET @ERR = @@ERROR
RETURN @ERR
GO


At the moment the delete procedure is merely:

CREATE PROCEDURE [dbo].[usp_deleteLearningArea]
(
@lID int
)
AS
DECLARE @ERR INT
SET @ERR= @lID
RETURN @ERR
GO


I'm getting the "Procedure or function ... has too many arguments specified". But only for the delete sp. What's different about that one?

Reply With Quote