The Procedure/Function page is used to select a database, driver, object type and script.
Set the parameters:
Select Database/Database. Use the drop-down list of repository objects to select the database. The driver specified in settings of the selected database is set automatically on changing a database.
Physical Name. In the field specify the physical object name (procedure or function), which is created on the DBMS server and which is corresponding with the one, created in the repository. It coincides with the identifier by default.
Drivers/Driver. Select the driver type in the drop-down list. For details about available drivers see the Supported DBMS subsection. The default driver used by the selected database is shown in bold. If required, one can select another driver and specify the SQL query text for this driver. It is relevant if the repository is to be used on servers with different DBMS and settings in repository are to be changed.
NOTE. Creating of procedures and functions is unavailable in SQLite DBMS because such object type is missing in this DBMS.
Object Type. Select type of created object in the drop-down list:
Procedure.
Function.
Script. In the field enter the header part, containing input and output parameters if required and procedure (function) body. Features of working with the field:
The script text should be written in the SQL language, which syntax depends on the selected DBMS.
The header part containing initialization code and physical name is generated automatically. They should not be specified in the script.
Create a parameter with the Function Result value for the function.
The description of parameters of the same type (input and output) should be in the same order as they are created on the Object Parameters page.
Example of creating a function in Oracle DBMS
Example of creating a procedure in Oracle DBMS
NOTE. If the PostgreSQL driver is selected, the first string of the script should contain the list of parameters and it should be in one string.
Apply for All DBMS. The button enables the user to set the script text to all DBMS. Clicking this button returns a request to confirm the operation. Confirmation is required if at least one driver other than the current one, has non-empty query text.
Load from Database. The button is used to refresh procedure or function text from database. Clicking this button returns a request to confirm the operation. If the answer is Yes, procedure or function text will be refreshed from database.
See also: