Some pages on Software Databases & Linux
Operating Systems Security Databases Database software Some Oracle utils Nice software Some Old pages
SQL guide PL/SQL guide Jersey and Open Source Linux File server Linux Firewalls Thin clients |
Generate PL/SQL base package for table(s). Now version 2.0 / December 2004 If you need help to customize, use or change the script, contact me for assistance. This is another script that I use now and then. It creates a pl/sql package with package specification and body code for one or more tables. It can create them as functions or procedures and with code for "insert, delete, update, select and refcursor" for one or more tables. i.e. Use "customer%" to generate code for all tables named customer-something, customer, customer_order, customer_address etc. Do not target too many tables since the package will be quite large and hard to customize. You will have to scan trough the code to change PK-generation and in-data test that are site specific. The script and package reads the Oracle data dictionary to retrieve table and key information.
The resulting code should compile as is in most cases in Oracle version 8-10. The code is then a good base to start to develop more application specific functions from. The script creates a temporary table and package that are dropped after generating the code. Make sure that the names "code_tmp" and "genpkg" does not conflict with any of your own objects since they will be dropped and overwritten in that case. The script contains comments and definitions that lets you specify what ( and how ) you want the code to be generated.
To use it: Start SQLPlus, Log in to the database and run the script with: @@GenPkg It will ask you for: table-name (may be wildcard), Package name, and Your Name (to be included in the code as reference/creator) This will generate a file with the name "Package name"_gen.pkg
|
>> Page 3 |
Copyright(@)2003 www.Timehole.com. You may use and redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or later. |
|
|