Only in DbVisualizer Pro
This feature is only available in the Pro edition. In the Free edition, please execute the corresponding SQL in the SQL Commander.
To create a new function:
- Expand nodes in the tree under the connection node in the Databases tab tree until you reach the Functions node,
- Select the Functions node and open the Create Function dialog from the right-click menu.
The details of the dialog depends on the database, but typically you need to:
- Enter an object name,
- Click the Add button in the Parameters area to add parameters,
- Enter a name and data type for each parameter. For some databases you can also enter a direction (typically IN, OUT, or INOUT) and a default value.
You can use the other buttons to the right of the parameter list to remove and move a parameter.
The dialog uses this information together with a simple sample body to compose a CREATE statement. For most databases, you can not enter the real code in the action dialog. The real code is often complex and large, so DbVisualizer provides a more powerful editing environment than would fit in a dialog via the Code Editor. What you create with the assistant should be seen as a template that you then complete and work with in the editor.
For some databases the sample code is editable because there is no way to write a generic sample that compiles. You must then modify the template to something that is syntactically correct, but we still recommend that you finish the real code in the Code Editor instead.
Click Execute in the dialog to create the new function.