Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. Database & SysAdmin
  3. Database
  4. Stored Procedures Out Put Parameter Returns Null What is missed.

Stored Procedures Out Put Parameter Returns Null What is missed.

Scheduled Pinned Locked Moved Database
sharepointdatabasequestionworkspace
5 Posts 3 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • G Offline
    G Offline
    greekius
    wrote on last edited by
    #1

    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]=@Key

    To Try

    declare @Value nchar
    EXEC [sp_GetConfigurationParameter] 'DBNL','DEVE',@Value
    select @Value

    Result NULL :'(

    S A 2 Replies Last reply
    0
    • G greekius

      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]=@Key

      To Try

      declare @Value nchar
      EXEC [sp_GetConfigurationParameter] 'DBNL','DEVE',@Value
      select @Value

      Result NULL :'(

      S Offline
      S Offline
      SomeGuyThatIsMe
      wrote on last edited by
      #2

      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 @Value

      I 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.

      G 1 Reply Last reply
      0
      • S SomeGuyThatIsMe

        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 @Value

        I 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.

        G Offline
        G Offline
        greekius
        wrote on last edited by
        #3

        i use sql 2005 server

        S 1 Reply Last reply
        0
        • G greekius

          i use sql 2005 server

          S Offline
          S Offline
          SomeGuyThatIsMe
          wrote on last edited by
          #4

          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.

          1 Reply Last reply
          0
          • G greekius

            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]=@Key

            To Try

            declare @Value nchar
            EXEC [sp_GetConfigurationParameter] 'DBNL','DEVE',@Value
            select @Value

            Result NULL :'(

            A Offline
            A Offline
            Ashfield
            wrote on last edited by
            #5

            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 @Value

            Bob Ashfield Consultants Ltd

            1 Reply Last reply
            0
            Reply
            • Reply as topic
            Log in to reply
            • Oldest to Newest
            • Newest to Oldest
            • Most Votes


            • Login

            • Don't have an account? Register

            • Login or register to search.
            • First post
              Last post
            0
            • Categories
            • Recent
            • Tags
            • Popular
            • World
            • Users
            • Groups