IBM Database Add-Ins for Visual Studio  

Editing the Source Code of Procedures, Functions, or Objects

If you develop your IBM® SQL or SPL routines and database objects in an IBM database project, you can edit their source code in the Visual Studio Code Editor. The editor supports cut, copy, paste, find and replace, menu and keyboard shortcuts, and syntax highlighting.

If you open a project that contains scripts for existing SQL or SPL procedures or functions, or objects, you can modify the source code (including SQL or SPL statements) in the editor. You can use the IBM® Database Add-Ins for Visual Studio to drop the old procedure, function, or object from the database and create a procedure, function, or object that reflects the changes that you made. You can also edit the procedure, function, or object. If your script file does not contain a drop statement or does not use an alter statement, attempting to build that script twice will cause a duplication error.

For an IDS database Editing the source code of overloaded procedures that are based on data type produces undefined results.

To edit the source code of a procedure, function, or object:

  1. In the Solution Explorer, right-click the procedure, function, or object that you want to modify, and then click Open.

    The source code of the procedure, function, or object opens in the editor.

  2. Edit the source code. You can:
    • Change or add SQL or SPL statements directly in the editor.
    • For a DB2 database Right-click in the editor, and then select Insert SQL on the shortcut menu to insert one of the following code fragments: IF, CASE, LOOP, REPEAT, WHILE, CURSOR, FOR, CREATE PROCEDURE, CREATE TABLE, CREATE VIEW, or CREATE FUNCTION (scalar and table).
  3. To save your changes, select File, and then select Save [file name].
  4. To close the file, select File, and then select Close.

See Also

Reviewing and Updating Scripts for Procedures, Functions, or Objects | Managing Procedures, Functions, and Objects


.NET Development Forum   DB2 FAQs   IDS FAQs

© Copyright IBM Corporation 2002, 2019. All Rights Reserved.