📄 generator_api.htm
字号:
So to remove all entries in the table encapsulation driver for the SCOTT schema, you would execute the following command:
<PRE>
PLGdoir.del (PLGte.driver, '%', 'SCOTT');
</PRE>
<A NAME="ClearObject"><I><B>Clear Object</B></I></A>
<P>
Call the PLGdoir.del procedure to delete all OIR entries for a specific object or objects in a schema. The header for this program is:
<PRE>
PROCEDURE PLGdoir.del
(drv IN VARCHAR2,
tab IN VARCHAR2 := NULL,
sch IN VARCHAR2 := NULL);
</PRE>
You must specify the driver, the table or object name, and the name of your schema.
<P>
So to remove all objects with names starting with "OE" in the table encapsulation driver for the SCOTT schema, you would execute the following command:
<PRE>
PLGdoir.del (PLGte.driver, 'OE%', 'SCOTT');
</PRE>
To remove, or set back to default, all settings for the employee table, you would execute the following command:
<PRE>
PLGdoir.del (PLGte.driver, 'employee', 'SCOTT');
</PRE>
<P>
<A NAME="ClearScreens"><I><B>Clear Screens and Individual Fields</B></I></A>
<P>
You can also clear entries for a specific screen and/or individual fields in the screen. To delete the contents of a screen, you will call the following program:
<PRE>
PROCEDURE PLGdoir.delscreen
(drv IN VARCHAR2,
tab IN VARCHAR2,
scr IN VARCHAR2,
sch IN VARCHAR2);
</PRE>
where drv is the driver (pass in PLGte.driver if you are working with the Table Encapsulation driver), tab is the name of the table/object, scr is the name of the screen, and sch is the schema.
<P>
The following sections show how to use this program to clear specific screens.
<I>Clear Configuration Screen</I>
<P>
To clear all entries for the Configuration Screen, execute the following command
<PRE>
PLGdoir.delscreen (
PLGdoir.c_global,
PLGdoir.c_global,
PLGdoir.c_scr_config,
PLGdoir.c_global,
);
</PRE>
Note: the configuration screen only appears at the global level, so you will always enter the global value for driver, table and schema.
<P>
To clear just the delimiter field of this screen, enter the following commands:
<PRE>
PLGdoir.del (
PLGdoir.c_global,
PLGdoir.c_global,
PLGdoir.c_gendelim,
PLGdoir.c_global
);
PLGdoir.del (
PLGdoir.c_global,
PLGdoir.c_global,
PLGdoir.c_drvdelim,
PLGdoir.c_global
);
</PRE>
<P>
<I>Clear Error Handling Screen</I>
<P>
To erase all the entries of the Error Handling screen, enter the following command:
<PRE>
PLGdoir.delscreen (
driver,
object,
PLGdoir.c_scr_errhdlg,
schema);
</PRE>
where driver is the name of the driver (PLGte.driver for the Table Encapsulation driver), object is the object designator (PLGdoir.c_global or a specific object name) and schema is the name of the schema (PLGdoir.c_global or a specific object name).
<P>
<I>Clear Performance/Tracing Screen</I>
<P>
To erase all the entries of the Performance/Tracing screen, enter the following command:
<PRE>
PLGdoir.delscreen (
driver,
object,
PLGdoir.c_scr_perftrc,
schema);
</PRE>
where driver is the name of the driver (PLGte.driver for the Table Encapsulation driver), object is the object designator (PLGdoir.c_global or a specific object name) and schema is the name of the schema (PLGdoir.c_global or a specific object name).
<P>
You can also erase the settings for specific fields in this screen with the following commands:
<P>
To erase the data caching option:
<PRE>
PLGdoir.del (driver, table, PLGdoir.c_preload, schema);
</PRE>
To erase the cursor variable option:
<PRE>
PLGdoir.del (driver, table, PLGdoir.c_usecurvar, schema);
</PRE>
To erase the stand-alone option:
<PRE>
PLGdoir.del (driver, table, PLGdoir.c_usesaprogs, schema);
</PRE>
To erase the PLVxmn trace option:
<PRE>
PLGdoir.del (driver, table, PLGdoir.c_usingxmn, schema);
</PRE>
<I>Clear Properties Screen</I>
<P>
To erase all the entries of the Properties screen, enter the following command:
<PRE>
PLGdoir.delscreen (
driver,
object,
PLGdoir.c_scr_properties,
schema);
</PRE>
where driver is the name of the driver (PLGte.driver for the Table Encapsulation driver), object is the object designator (PLGdoir.c_global or a specific object name) and schema is the name of the schema (PLGdoir.c_global or a specific object name).
<P>
You can also erase the settings for specific fields in this screen with the following commands:
<P>
To erase the driver location option:
<PRE>
PLGdoir.del (driver, table, PLGdoir.c_drvdir, schema);
</PRE>
To erase the Generate to location option:
<PRE>
PLGdoir.del (driver, table, PLGdoir.c_gendir, schema);
</PRE>
To erase the customization file setting:
<PRE>
PLGdoir.delsrc (drv, tab, PLGdoir.c_custsrc_seq, sch);
</PRE>
To erase the table for view setting:
<PRE>
PLGdoir.del (driver, table, PLGdoir.c_gendir, schema);
</PRE>
To erase the app prefix setting:
<PRE>
PLGdoir.del (driver, table, PLGdoir.c_appprefix, schema);
</PRE>
To erase the company setting:
<PRE>
PLGdoir.del (driver, table, PLGdoir.c_company, schema);
</PRE>
<P>
<I>Clear Primary Key Generation Screen</I>
<P>
To erase the entire screen of all primary key information (only applies at table or view level):
<PRE>
PLGdoir.delscreen (
driver,
table,
PLGdoir.c_scr_primkey,
schema);
</PRE>
where driver is the name of the driver (PLGte.driver for the Table Encapsulation driver), object is the object designator (PLGdoir.c_global or a specific object name) and schema is the name of the schema (PLGdoir.c_global or a specific object name).
<P>
You can also erase the specific entry by executing one of the following depending on the current setting (you can also just run all 3 of them -- that's what the PLGdoir.delscreen program does):
<PRE>
PLGdoir.del (drv, tab, PLGdoir.c_sequence, sch);
PLGdoir.del (drv, tab, PLGdoir.c_pkygenproc, sch);
PLGdoir.del (drv, tab, PLGdoir.c_pkygenfunc, sch);
</PRE>
<P>
<I>Clear Columns Screen</I>
<P>
To erase the entire screen of all column settings on all rows:
<PRE>
PLGdoir.delscreen (
driver,
table,
PLGdoir.c_scr_columns,
schema);
</PRE>
where driver is the name of the driver (PLGte.driver for the Table Encapsulation driver), object is the object designator (PLGdoir.c_global or a specific object name) and schema is the name of the schema (PLGdoir.c_global or a specific object name).
<P>
You can also erase the settings for specific fields in this screen with the following commands:
<P>
To erase the hidden column setting in a specific row:
<PRE>
PLGdoir.delattr (
driver, table, <column>, PLGdoir.c_hidden, 1, schema);
</PRE>
To erase the column function setting in a specific row:
<PRE>
PLGdoir.delattr (
driver, table, <column>, PLGdoir. c_colfunc, 1, schema);
</PRE>
To erase the update column setting in a specific row:
<PRE>
PLGdoir.delattr (
driver, table, <column>, PLGdoir.c_updcol, 1, schema);
</PRE>
<P>
<B><FONT SIZE=4><P><A NAME="Customizing">Customizing Generated Code</A> </B></FONT>
<P>
The PL/Generator Object Information Repository offers many different ways to change the code it generates to meet your needs. There will be times, however, when you have other programs you want to add to the package. Or you may need to change the insert behavior to handle unusual requirements. You should set as a goal for yourself that you do not modify the packages generated by PL/Generator , but instead find ways to provide additional <I>input</I> to PL/Generator so that the resulting code meets your needs. The advantage to this approach is that when the table changes, you can regenerate the package without losing your customization.
<P>
To customize the generated code, you will follow these steps:
<OL>
<LI>Decide the level at which you want to make the customizations. You can customize at the global level (all tables in all schemas), the schema level (all tables in a specific schema) or at the table level. You will create a separate customization file for each level. </LI>
<LI>Copy the "empty" customization file, tecust.gdr, to another file name for your customization purposes. You might name the global customization file <B>gcust.gdr</B>, the schema customization file <B><schema></B>.gdr (where <schema> is the name of the schema, as in scott.gdr), and the table customization file <B><table></B>.gdr (as in employee.gdr).</LI>
<LI>Add code to the section of the driver which you want to customize.</LI>
<LI>Register your customization file in the OIR. You do this by calling the PLGdoir.defcustsrc procedure. If you want, for example, to register a table-specific customization file for the Table Encapsulation driver for the department table, you would issue this command:</LI>
</OL>
<DIR>
<DIR>
<DIR>
<DIR>
<FONT FACE="Courier,Courier New" SIZE=1><P>PLGdoir.defcustsrc (PLGte.driver, 'dept.gdr', TRUE, 'department', USER); </DIR>
</DIR>
</DIR>
</DIR>
</FONT><P>If you wanted to define a schema-level customization level file, issue a command like this: <DIR>
<DIR>
<FONT FACE="Courier,Courier New" SIZE=1><P>PLGdoir.defcustsrc (PLGte.driver, USER || '.gdr', TRUE, PLGdoir.c_global, USER); </DIR>
</DIR>
</FONT><P>Finally, if you want to define a global customization file, use this command: <DIR>
<DIR>
<FONT FACE="Courier,Courier New" SIZE=1><P>PLGdoir.defcustsrc (PLGte.driver, 'gcust.gdr', TRUE, PLGdoir.c_global, PLGdoir.c_global); </DIR>
</DIR></FONT>
<P>
To get more information about how to define your customizations in these file, please refer to the on-line help system.
<P>
<B><FONT SIZE=4><P><A NAME="Managing">Managing Privileges</A> </B></FONT>
<P>
PL/Generator allows you to specify the operations that a particular user can perform.
You do this by adding or removing privileges for a user. In most cases, as with the
rest of PL/Generator and its Object Information Repository, you can set a privilege at
the global, schema, or individual table level.
<P>
Note: if the user connects to PL/Generator as the same schema that owns PL/Generator code
and objects, that user will be privileged to perform ALL operations. Specific PLGpriv
settings, in other words, will be ignored.
<P>
There are presently six different types of privileges you can assign or remove for a user:
<TABLE CELLSPACING=1 CELLPADDING=7 WIDTH=582>
<TR><TD WIDTH="24%" VALIGN="TOP">
<P>Define driver</TD>
<TD WIDTH="76%" VALIGN="TOP">
<P>Define a new driver.</TD>
</TR>
<TR><TD WIDTH="24%" VALIGN="TOP">
<P>Modify driver</TD>
<TD WIDTH="76%" VALIGN="TOP">
<P>Modify characteristics of an existing driver.</TD>
</TR>
<TR><TD WIDTH="24%" VALIGN="TOP">
<P>Modify object</TD>
<TD WIDTH="76%" VALIGN="TOP">
<P>Modify the characteristics of an object (table, column, etc.).</TD>
</TR>
<TR><TD WIDTH="24%" VALIGN="TOP">
<P>Modify privilege</TD>
<TD WIDTH="76%" VALIGN="TOP">
<P>Modify the privileges of a user for a specified level in the hierarchy.</TD>
</TR>
<TR><TD WIDTH="24%" VALIGN="TOP">
<P>Define error</TD>
<TD WIDTH="76%" VALIGN="TOP">
<P>Define an error to be recognized and propagated by PL/Generator</TD>
</TR>
<TR><TD WIDTH="24%" VALIGN="TOP">
<P>All Privileges</TD>
<TD WIDTH="76%" VALIGN="TOP">
<P>All the above privileges</TD>
</TR>
</TABLE>
<P>	
<P>These privileges are also defined in the specification of the PLGpriv package using named constants as follows: <DIR>
<DIR>
<FONT FACE="Courier,Courier New" SIZE=1><P>defdrv CONSTANT CHAR(6) :=
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -