This application generates PL/SQL code based on a simple markup syntax. It is inspired by the "Quick SQL" utility that is included with APEX.
See this blog post for more information.
Input
Start a line with the keyword package
followed by the package name. Optionally, add comments using --
.
You can also add the following attributes to each package:
[logger]
generates code to log the execution of all subprograms in the package
[crud-table:table_name]
specifies a table name that is used as the default table for crud-style subprograms, unless a different value is specified at the individual subprogram level.
[crud-key:column_name]
specifies a column name that is used as the default primary key column name for crud-style subprograms, unless a different value is specified at the individual subprogram level.
Subprograms (procedures and functions) are added on the lines following the package, indented by two spaces. Specify the name of the subprogram, followed by the parameter list in parentheses. By default, a procedure will be generated. To generate a function, add return
and then the data type to be returned. Optionally, add comments using --
.
You can also add the following attributes to each subprogram:
[private]
removes the subprogram from the package specification, making the subprogram private to the package body
[logger]
generates code to log the execution of the subprogram
[crud-table:table_name]
specifies a table name that is used as the table for crud-style subprograms
[crud-key:column_name]
specifies a column name that is used as the primary key column name for crud-style subprograms
[crud-create]
generates an INSERT statement
[crud-read]
generates a SELECT INTO statement
[crud-update]
generates an UPDATE statement
[crud-delete]
generates a DELETE statement
Add a blank line between each package.
See also the provided example inputs and resulting output.
Output
Click the buttons to generate output:
- Generate (to screen): The generated code is shown on screen and can be copied.
- Download Script: Creates a single file containing all generated code.
- Download Zip: Creates a zip file that contains one file per package specification and package body, as well as an install script.
Settings
The settings dialog allows you to change the initials of the user generating the code.
Changelog
- Version 1.2: Syntax highlighting of generated code. "Quick CRUD" generator.
- Version 1.1: Minor improvements.
- Version 1.0: Initial release.