Edit Stored Procedure

Use the Edit Stored Procedure form to create extensions to eligible stored procedures.

You can use this form to copy a base stored procedure method from a list and use it as a starting point to extend and modify the functionality of the selected stored procedure. You can also use it to modify an existing extgen_ stored procedure method and resubmit it to the database.

This form has these fields and options:

Field/Option Description/Comments
Stored Procedure

Use this drop-down list to accomplish either of these tasks:

  • To create a new extgen_ method, select the base stored procedure method to extend.
  • To modify or replace an existing extgen_ method, select the method to replace.
    Note: Extended stored procedures are identified by the "extgen_" prefix in the procedure name; for example: "extgen_SomeSp".

You can launch this form by clicking the Edit Stored Procedure button on the EXTGEN Listing form. If you do, this field is automatically populated with the name of the extended stored procedure that was selected on that form.

Remove to Extgen

When using this form to create a new extgen_ method, use this option to ensure that certain code is removed from the base method before the extended version is created.

That code is the code that causes the system to look for any stored procedures that have the "extgen_" prefix. If any extgen_ procedures are found, then, the system invokes the extgen_ version in place of the base version. If that code were to be kept in the extended version of the stored procedure method, it would cause an infinite loop to be created when the stored procedure is invoked.

[Unlabeled text box]

This text box displays a copy of the code for the selected stored procedure. If the stored procedure is a base version, the code displays here when you click Copy Procedure. If the stored procedure is an extgen_ version, the code displays here when you click Open Extgen.

Note: You cannot test custom code you develop here. We recommend that you develop and test your custom code in a local SQL test environment before copying it here and then submitting it.
Copy Procedure

To make a copy of a selected base method that you can then modify for your own use, click this button. When clicked, the code for the stored procedure displays in the editable text field.

Submit

To submit the code currently displayed in the unlabeled text box to the database, click this button.

Doing this makes the submitted method code the currently active version of the stored procedure method.

Note: This is typically the last button to click when working in this form.
Drop Extgen

To remove the selected extgen_ method from the database, click this button.

This effectively restores the base version to primary status.

Open Extgen

To view—and optionally modify—the code for the selected extgen_ method, click this button. When clicked, the code for the stored procedure displays in the editable text field. This allows you to modify the existing code and resubmit it.

Note: You cannot test custom code you develop here. We recommend that you develop and test your custom code in a local SQL test environment before copying it here and then submitting it.
Note: This is typically used in conjunction with the Remove to Extgen option.
Compare w/ Base

To launch the Method Compare form for a selected extgen_ method, click this button. That modal form allows you to view and compare the code for both the base version and an extgen_ version of the stored procedure.

For more information, see Method Compare.