December 7, 2011 at 2:16 am
hi,
i have a stored procedure with 6 input parameters and many output ones
i want to insert the returned values of the stored procedure into a table
so i have created a table with the exact output parameters of the stored procedure
now when i try to populate the table with this
INSERT INTO tmp_spvisana EXEC spvisana '03.21.2011 11:53:00','03.21.2011 11:53:00',5211, 5211, 13821, 13821
i have an error
Procedure or function 'SPVISANA' expects parameter '@vinum', which was not supplied.
@vinum is the first out parameter and is not supposed to be taken as input
any help is welcome
thanks and good day
December 7, 2011 at 3:08 am
Your issue doesn't seem to be related to the INSERT, but to the procedure call itslef.
Try using named parameters:
EXEC procedure @param1 = value1, @param2 = value2...
-- Gianluca Sartori
December 7, 2011 at 3:27 am
Also, you're confusing the output parameters of the procedure with the result set. You can only use INSERT INTO to insert the result set - not the output parameters.
Try something like this. Forgive any syntax errors - I'm doing it from memory:
DECLARE @vinum int -- or whatever data type it is
EXEC spvisana
@param1 = '03.21.2011 11:53:00'
,@param2 = '03.21.2011 11:53:00'
,@param3 = 5211
,@param4 = 5211
,@param5 = 13821
,@param6 = 13821
,@vinum = @vinum OUTPUT
INSERT INTO MyTable (vinum, col1, col2)
VALUES (@vinum, value1, value2)
John
December 7, 2011 at 3:31 am
thanks guys !
Viewing 4 posts - 1 through 3 (of 3 total)
You must be logged in to reply to this topic. Login to reply