K2 BLACKPEARL PRODUCT DOCUMENTATION: USER GUIDE
Stored Procedures

SQL Server Service - Stored Procedures

For integration with stored procedures this service will cater for two method types:

  1. Expose methods of type List where stored procedures return data
  2. Expose methods of type Execute where stored procedures return no data
Important: Output and Read methods are unsupported.

Fig. 1. SQL Service Object Store Procedure Methods displayed in the K2 Object Browser

Samples of Stored Procedures 

To return @@IDENTITY creates a List stored procedure.

Copy Code   

  

CREATE PROCEDURE [dbo].[ToReturnIdentityValue]

      @Desc NVARCHAR(50),

      @TextValue NVARCHAR(MAX) = 'no value supplied',

      @IntValue INT = -1

AS

BEGIN

      INSERT INTO [WithCRUD]

           ([Description]

           ,[TextValue]

           ,[IntValue])

     VALUES

           (@Desc

           ,@TextValue

           ,@IntValue)

 

      SELECT @@IDENTITY

END

GO 

 ONLY Execute method creates an Execute method

Copy Code   

  

CREATE PROCEDURE [dbo].[OnlyExecute]

      -- Add the parameters for the stored procedure here

      @ID INT = 0,

      @Desc NVARCHAR(50),

      @TextValue NVARCHAR(MAX) = 'no value supplied',

      @IntValue INT = -1

AS

BEGIN

      INSERT INTO [WithoutCRUD]

           ([ID]

           ,[Description]

           ,[TextValue]

           ,[IntValue])

     VALUES

           (@ID

           ,@Desc

           ,@TextValue

           ,@IntValue)

END

GO 

ONLY List method creates a List method

Copy Code   

  

CREATE PROCEDURE [dbo].[OnlyList]

      -- Add the parameters for the stored procedure here

AS

BEGIN

      SELECT [ID]

      ,[AutoNumber]

      ,[Description]

      ,[TextValue]

      ,[IntValue]

  FROM [WithoutCRUD]

END

GO 

See Also

 

 


K2 blackpearl Help 4.6.10 (4.12060.1690.0)