Renaming a Procedural Object

You can rename a procedural object in SQL Editor, whether or not it is currently open.

Note

After renaming you must find and update existing references to the renamed object. For example, if a procedure named caller-proc references a procedure named proc1, and you rename proc1 to newproc1, you must edit the reference in caller-proc.

To rename a procedural object that is open in SQL Editor:

  1. Highlight the object name and right-click.

  2. Choose Rename object-type (Alt-Shift-R) from the context menu.

    For example, to rename a stored procedure choose Rename Procedure.

  3. Enter a new name in the Rename dialog and click OK.

    The Warning dialog appears with the warning The reference will not be updated appears, unless you have disabled it.

  4. (Optional) To avoid this warning in the future, click Do not remind me again and click OK.

  5. If there are unsaved changes, complete the Saved Modified Resources dialog:

    1. (Optional) Click Always save modified resources automatically prior to renaming to avoid this step in the future.

    2. Click OK.

To rename a procedural object that is not currently open:

  1. Right-click the object in its Database Explorer folder.

    Folders for procedural objects

    FolderObjects
    Procedures & Functions

    Stored procedures

    User-defined functions (Adaptive Server Anywhere or Sybase IQ)

    Tables|Triggers

    Triggers (Adaptive Server Anywhere or Adaptive Server Enteprise)

    Events

    Events (Adaptive Server Anywhere or Sybase IQ)

  2. Choose Rename object-type (Alt-Shift-R) from the context menu.

    For example, to rename a stored procedure choose Rename Procedure.

  3. Enter a new name in the Rename dialog and click OK.

    The Warning dialog appears with the warning The reference will not be updated, unless you have disabled it.

  4. (Optional) To avoid this warning in the future, click Do not remind me again and click OK.

    The procedural object is renamed, and the new name appears in Database Explorer.

Saving a Procedural Object Definition to a Database

Send your feedback on this help topic to Sybase Tech Pubs: pubs@sybase.com