Easily find issues by searching: #<Issue ID>
Example: #1832
Easily find members by searching in: <username>, <first name> and <last name>.
Example: Search smith, will return results smith and adamsmith
Aqua Data Studio / nhilam |
Follow
827
|
Aqua Data Studio can access and edit Procedures, Functions and Packages through the Schema Browser. Stored Procedures are subroutines stored in a database's dictionary and are often used for data validation and access control. They collect logic usually spread across several statements in complex actions for access from a single call. Functions are blocks of code to perform a series of actions used to extend the functionality of a database server. User defined functions are defined with CREATE FUNCTION in SQL statements. They can be used for converting and evaluating data or performing other actions. Packages, in Oracle, are used for encapsulating a group of functions and procedures. Packages have specifications (definitions) and bodies. They provide containers for related items. Depending on the database version and vendor, Package, Procedure and Function debugging is also available. See the SQL Debuggers section for more. Procedure Editor When a Procedure has been opened with the Procedure Editor, the button normally associated with Executing a statement becomes associated with compiling. To the right of it is a similar button with a gear behind it for executing the procedure.
An enhanced feature in the ADS Procedure Editor is that tables can be sorted within stored procedures now. Creating and Executing a Sample Stored Procedure in Aqua Data Studio (DB2 UDB)
Create table DDL CREATE TABLE "DB2ADMIN"."AQUA_CUSTOMER" ( Insert Statements
SAMPLE DB2 UDB STORED PROCEDURE This stored procedure when executed will return all rows from the table DB2ADMIN.AQUA_CUSTOMER based on the condition that Aqua_Code parameter is equal to the specified TITLE column in the table. For example, if I want the stored procedure to return all rows from the table with TITLE=CTO, I specify the input parameter AQUA_CODE as 'CTO'. If its all the Managers I want, just need to specify input parameter AQUA_CODE as 'MANAGER'. A cursor is declared which loops through each row in the Table.
Function Editor Aqua Data Studio’s PL/SQL and Function editor offers the user a compilation and execution environment for the development of functions.
Creating a Sample User Defined Function in DB2 UDB
Create table DDL CREATE TABLE "DB2ADMIN"."AQUA_CUSTOMER" ( Insert Statements
SAMPLE DB2 USER DEFINED FUNCTION This User Defined Function when executed will delete row from the table DB2ADMIN.AQUA_CUSTOMER based on the input parameter Aqua_Code. This parameter is matched to the specified TITLE column in the table. For example, if you want the UDF to delete rows from the table with TITLE=Manager, you need to specify the input parameter AQUA_CODE as 'Manager'.
Executing DB2 USER DEFINED FUNCTION Connect to the Database Server and Open a Query Analyzer. Type the following and Execute to see the UDF result SELECT * FROM TABLE(DB2ADMIN.UDF_SAMPLE_1('Manager')) AS FUNCTABLE
Package Editor
The Oracle Package Editor allows users to edit packages more easily by providing both the definition and the body in one tab window. The editor also provides a drop down of all functions & procedures in the package for quick navigation.
|
|
About AquaClusters Privacy Policy Support Version - 19.0.2-4 AquaFold, Inc Copyright © 2007-2017