Stored Procedures Out Put Parameter Returns Null What is missed.
-
I created a table for keeping Configuration parameters. When i wanna get the value via stored proc, i got null. Could u check me my stored procedure pls.
CREATE PROCEDURE [dbo].[sp_GetConfigurationParameter]
@Key char(4),
@Type char(4),
@Value nchar OUTPUT
AS
SET NOCOUNT ON;
SELECT @Value=[Value] FROM VpConfParameters WHERE [Type]=@Type AND [Key]=@KeyTo Try
declare @Value nchar
EXEC [sp_GetConfigurationParameter] 'DBNL','DEVE',@Value
select @ValueResult NULL :'(
-
I created a table for keeping Configuration parameters. When i wanna get the value via stored proc, i got null. Could u check me my stored procedure pls.
CREATE PROCEDURE [dbo].[sp_GetConfigurationParameter]
@Key char(4),
@Type char(4),
@Value nchar OUTPUT
AS
SET NOCOUNT ON;
SELECT @Value=[Value] FROM VpConfParameters WHERE [Type]=@Type AND [Key]=@KeyTo Try
declare @Value nchar
EXEC [sp_GetConfigurationParameter] 'DBNL','DEVE',@Value
select @ValueResult NULL :'(
assuming that there is data that matches your query in the table, you could forego the output parameter and just select [Value] then your exec statement would be
declare @Value nchar
EXEC @value = [sp_GetConfigurationParameter] 'DBNL','DEVE',@Value
select @ValueI know that works in sql server 2k, and i'm fairly certain it wont work in oracle.
Alcohol the cause of and solution to all of life's problems. Please remember to rate helpful or unhelpful answers, it lets us and people reading the forums know if our answers are any good.
-
assuming that there is data that matches your query in the table, you could forego the output parameter and just select [Value] then your exec statement would be
declare @Value nchar
EXEC @value = [sp_GetConfigurationParameter] 'DBNL','DEVE',@Value
select @ValueI know that works in sql server 2k, and i'm fairly certain it wont work in oracle.
Alcohol the cause of and solution to all of life's problems. Please remember to rate helpful or unhelpful answers, it lets us and people reading the forums know if our answers are any good.
-
as far as i know you can still select values out of a usp in sql server 2k5.
Alcohol the cause of and solution to all of life's problems. Please remember to rate helpful or unhelpful answers, it lets us and people reading the forums know if our answers are any good.
-
I created a table for keeping Configuration parameters. When i wanna get the value via stored proc, i got null. Could u check me my stored procedure pls.
CREATE PROCEDURE [dbo].[sp_GetConfigurationParameter]
@Key char(4),
@Type char(4),
@Value nchar OUTPUT
AS
SET NOCOUNT ON;
SELECT @Value=[Value] FROM VpConfParameters WHERE [Type]=@Type AND [Key]=@KeyTo Try
declare @Value nchar
EXEC [sp_GetConfigurationParameter] 'DBNL','DEVE',@Value
select @ValueResult NULL :'(
You have missed OUTPUT in your test
greekius wrote:
declare @Value nchar EXEC [sp_GetConfigurationParameter] 'DBNL','DEVE',@Value select @Value
Should be
declare @Value nchar
EXEC [sp_GetConfigurationParameter] 'DBNL','DEVE',@Value OUTPUT
select @ValueBob Ashfield Consultants Ltd