The Telerik Platform product is retired.Learn more

Getting Started with Stored Procedures

Getting Started with Stored Procedures

Before you can execute a stored procedure or report on your data server using Telerik Platform you need to map it to an HTTP endpoint. You also need to map its parameters and, optionally, change their default values. Once you have done that, you are ready to execute the stored procedure.

This article focuses on how to do this using the portal. For information on using the RESTful API, see the rest of the articles in this sections.

Content at a glance:

  1. Give the Endpoint a Name
  2. Select a Stored Procedure to Map
  3. Map the Stored Procedure Parameters
  4. Set Permissions
  5. Execute a Stored Procedure


Give the Endpoint a Name

Start by giving the stored procedure endpoint a name. The name becomes a part of the web service endpoint that you use to execute the stored procedure (from the portal or the RESTful API). It must be unique within your Telerik Platform app.

  1. Open your Telerik Platform app.
  2. From the left-hand navigation pane choose Business Logic > Explorer.
  3. Click the Create button in the middle pane and select Function from a stored procedure. Alternatively, click the + button next to Stored Procedures in the code explorer on the right.
  4. Enter a name in the modal dialog and click OK. You can change the name later.

"Create function from a stored procedure modal dialog"

Select a Stored Procedure to Map

Telerik Platform reaches to your database servers and reads each database's schema and catalogs to find stored procedures along with their parameters. After it is ready, you are presented with a screen to choose a stored procedure:

  1. From the Select Data Connector drop-down box, select the data connector that you want to use.
  2. From the Select source Stored Procedure select the name of the stored procedure that you want to map.
  3. Optionally, change the name of the endpoint in Function name.

"Map a function to a stored procedure"

Map the Stored Procedure Parameters

Mapping parameters is currently not supported when connecting to Salesforce. Salesforce reports appear without parameters.

The parameters of a stored procedure (if any) are automatically read at the time of loading the stored procedure from the database schema. Telerik Platform automatically binds each of them to an HTTP endpoint parameter. You can:

  • Rename the endpoint parameter by entering a new name in the respective text box
  • Select the parameter type using the drop down box for the parameter
  • Specify a default value by clicking the gear icon and entering the value
  • Mark the parameter as required by clicking the gear icon and clicking the respective check-box

"Map the parameters of the stored procedure"

If you remove a parameter from the stored procedure statement in the SQL database, the respective parameter is removed from the HTTP endpoint parameter mapping as well. Similarly, adding parameters in the SQL database adds parameters to the procedure definition in your Telerik Platform app. In both cases you need to update the endpoint mapping for the changes to take effect by clicking the Save button.

"Unmap the parameters of the stored procedure"

Set Permissions

To specify who can execute the mapped stored procedure, click the gear icon next to the stored procedure name in the code explorer and select Permissions.

You can read more about permissions in Security in Stored Procedures.

"Set the permissions for executing the stored procedure endpoint"

Execute a Stored Procedure

After you map a stored procedure, you can immediately execute it in the portal. This option can be useful for quick testing or if you only execute the function manually. In those cases you don't need to write any code to call the endpoint.

Take these steps to execute a stored procedure from the portal:

  1. Select the stored procedure name in the code explorer's code tree.
  2. Click the Execute button in the toolbar.
  3. Define the request in the dialog box that opens.

    "Execute stored procedure from the Telerik Platform"

  4. Click Execute in the dialog box.

Normally, you would execute a stored procedure programmatically using its unique HTTP endpoint. See Executing Stored Procedures for information on how to do that.

See Also

Contact us: +1-888-365-2779
Copyright © 2016-2018, Progress Software Corporation and/or its subsidiaries or affiliates. All rights reserved.