⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 release notes.htm

📁 Oracle PL/SQL procedure generator (second generator type)
💻 HTM
📖 第 1 页 / 共 3 页
字号:
<!DOCTYPE HTML PUBLIC "-//SoftQuad Software//DTD HoTMetaL PRO 5.0::19981217::extensions to HTML 4.0//EN" "hmpro5.dtd">
 
<HTML>
 
<HEAD>
<TITLE>PL/Generator V1.1 Release Notes</TITLE>
</HEAD>

<BODY BGCOLOR="white" BACKGROUND="bar_products.gif">
<DIR>

<DIR>

<P><B><FONT FACE="Arial" SIZE="4">Release Notes for PL/Generator 1.1</FONT></B>
</P>
<P>Copyright 1999 Quest Software, Inc. Author: Steven Feuerstein Date: 4/12/99 </P>
<P><B><FONT FACE="Arial" SIZE="4">Summary</FONT></B></P>
<P>This document describes the enhancements and changes that are new to
PL/Generator 1.1. </P>
<P><A HREF="#Highlights">Highlights</A></P>
<P><A HREF="#Installing">Installing PL/Generator 1.1</A> </P>
<DIR>
</DIR>
<P><A HREF="#Saving"><FONT SIZE="2">Saving Changes to the Header
File</FONT></A><BR>
<A HREF="#Requirements"><FONT SIZE="2">Installation Requirements</FONT></A><BR>
<A HREF="#Performance"><FONT SIZE="2">Performance Improvements</FONT></A></P>
<P><A HREF="#Changes">Changes to the Screen Interface</A> </P>
<P><A HREF="#Features">New Features for Code Generation</A></P>
<DIR>
</DIR>
<P><A HREF="#Abbrv"><FONT SIZE="2">Setting Object Abbreviation</FONT></A> <BR>
<A HREF="#Automatic"><FONT SIZE="2">Automatic Invalid Identifier
Correction</FONT></A> <BR>
<A HREF="#GenDB"><FONT SIZE="2">Generating to the Database</FONT></A> <BR>
<A HREF="#Avoidance"><FONT SIZE="2">Complete Avoidance of UTL_FILE</FONT></A> 
<BR>
<A HREF="#Primary"><FONT SIZE="2">The Update Primary Key Procedure</FONT></A> 
<BR>
<A HREF="#Columns"><FONT SIZE="2">Applying Functions to Columns</FONT></A> </P>
<P><A HREF="#Working">Working with PL/Generator</A></P>
<DIR>
</DIR>
<P><A HREF="#Defining"><FONT SIZE="2">Defining Standard Audit
Columns</FONT></A><BR>
<A HREF="#Size"><FONT SIZE="2">Reducing Size of Long Identifier
Names</FONT></A> </P>
<P><A HREF="#Driver">Changes to Table Encapsulation Driver and Generated
Code</A></P>
<P><A HREF="#Bugs">Bugs Fixed in PL/Generator 1.1</A></P>
<P><A HREF="#Limitations">Limitations/Known Problems</A> </P>
<P></P>
<HR>
<DIR>
</DIR>
<DIR>
</DIR>
<P><B><FONT FACE="Arial" SIZE="4"><A
NAME="Highlights">Highlights</A></FONT></B></P>
<UL>
</UL>
<UL>
<LI>Improved generation performance </LI>
<LI>Automatic detection and correction of invalid identifiers (containing more
than 30 characters) </LI>
<LI>Fixes to bugs in Release 1.0 </LI>
<LI>Reduced use of (and, under some circumstances, complete avoidance of) the
UTL_FILE built-in package</LI>
</UL>
<DIR>
</DIR>
<DIR>
</DIR>
<P><B><FONT FACE="Arial" SIZE="4"><A NAME="Installing">Installing PL/Generator
1.1</A></FONT></B></P>
<P>Note: the production version of this release of PL/Generator will contain
updated installation instructions. For now, however, you should follow the
steps outlined below:</P>
<OL>
</OL>
<OL>
<LI><B>Set the privileges for the PL/Generator account.</B> Even if you have
already defined your PL/Generator schema, please connect to SYS and run the
following script:</LI>
</OL>
<P>plggrant.sql &lt;plg-schema&gt;</P>
<P>where &lt;plg-schema&gt; is the name of the schema owning the PL/Generator
objects. Then disconnect from the SYS account and connect to the PL/Generator
schema.</P>
<P><B></B></P>
<UL>
<LI>Remove the version of PL/Vision that came with PL/Generator 1.0. [Note: if
you have installed a licensed version of PL/Vision Professional independently
of your use of PL/Generator, then do <I>not</I> remove PL/Vision.] To do this,
connect to the schema owning the PL/Generator code and run the following two
files (located in the source subdirectory for PL/Generator):</LI>
</UL>
<P>plvrem.sql</P>
<P>This script will remove the PL/Vision tables, programs and synonyms from the
PL/Generator environment. You can also delete all files starting with the plv*
prefix.</P>
<P><B></B></P>
<UL>
<LI>Install the new PL/Generator objects. To do this, you will connect to the
schema owning PL/Generator and run the following script if you have Oracle8: 
</LI>
</UL>
<DIR>
</DIR>
<DIR>
</DIR>
<DIR>
</DIR>
<DIR>
</DIR>
<P>plginst8.sql</P>
<P>If you have Oracle7, run the following script:</P>
<DIR>
</DIR>
<P>plginst7.sql</P>
<P>These scripts will create all the necessary objects (leaving your existing
Object Information Repository information in place). It will also confirm the
installation and show you any problems that had been encountered during the
installation. </P>
<P><B><I><FONT FACE="Arial"><A NAME="Saving">Saving Changes to Header
File</A></FONT></I></B></P>
<P>If you have made any changes to the header file (tehdr.gdr), you will need
to save that version of the header file under a different name before you
install the upgraded version. After the install is complete, you can copy your
own header file back to the name tehdr.gdr. You will then also need to edit
that file, changing the string:</P>
<DIR>
</DIR>
<P>{filename}</P>
<P>to the following string:</P>
<DIR>
</DIR>
<P>[target]</P>
<P><B><FONT FACE="Arial" SIZE="4"><A NAME="Requirements">Installation
Requirements</A></FONT></B></P>
<P>PL/Generator 1.1 makes use of a number of additional database tables to
provide additional flexibility and improve performance of the product. These
tables all make use of the default tablespaces for the PL/Generator schema. The
tables require a total, initial allocation of 2.3 megabytes. </P>
<P>Additionally, you should have 5 megabytes of space available in the SYSTEM
tablespace for the code objects.</P>
<P><B><FONT FACE="Arial" SIZE="4"><A NAME="Performance">Performance
Improvements</A></FONT></B></P>
<P>Several changes were made to the underlying generation engine to improve
performance, even as additional capabilities were added to the engine. These
changes are transparent to users, but are summarized below:</P>
<UL>
</UL>
<UL>
<LI>All driver information, excepting that contained in your customization
files and the header file, is stored and read from a database table,
plg_driver_source. This table is loaded with data on installation. </LI>
<LI>Static generation data is stored in a variety of in-memory caches so that
it can be retrieved and manipulated more efficiently. </LI>
<LI>The generation engine has been re-coded to avoid repetitive, unnecessary
operations.</LI>
</UL>
<DIR>
</DIR>
<DIR>
</DIR>
<P><B><FONT FACE="Arial" SIZE="4"><A NAME="Changes">Changes to Screen
Interface</A></FONT></B></P>
<P>The screen interface of PL/Generator now performs a number of checks
whenever it starts to ensure that PL/Generator has been installed successfully.
This enhancement should be transparent to you if you installed the product
successfully. If there was a problem (or if you mistakenly skipped the server
side installation entirely), the screen will list the missing or problematic
elements and request that you complete the server side installation.</P>
<P><B><FONT FACE="Arial" SIZE="4"><A NAME="Features">New Features for Code
Generation</A></FONT></B></P>
<P>The following features have been added to the PL/Generator 1.1 backend API.
Not all of these features are accessible directly from within the screen
interface. In those cases, you will need to make calls to the underlying API
procedures and functions.</P>
<P><B><I><FONT FACE="Arial"><A NAME="Abbrv">Setting Object
Abbreviation</A></FONT></I></B></P>
<P>You can now provide an abbreviation for your object (usually table or view)
name. When PL/Generator constructs an identifier that is too long, it will
replace any occurrence of the object name with its abbreviation. This will
often resolve the invalid identifier situation.</P>
<P>To set an object abbreviation, call the PLGdoir.setobjabbrev procedure as
defined below:</P>
<PRE>
PROCEDURE PLGdoir.setobjabbrev
   (drv IN VARCHAR2,
    tab IN VARCHAR2,
    abbrev IN VARCHAR2,
    sch IN VARCHAR2 := NULL);</PRE>

<P><FONT SIZE="2">So to specify &quot;emp&quot; as an abbreviation for the
&quot;employee&quot; table in the Table Encapsulation driver, you would execute
this command in SQL*Plus or some other PL/SQL environment:</FONT></P>
<PRE>
PLGdoir.setobjabbrev (
PLGte.driver,
'employee',
'emp',
USER);</PRE>

<P><FONT SIZE="2">You can also obtain the currently-defined abbreviation for a
table by calling the following function:</FONT></P>
<PRE>
FUNCTION PLGdoir.objabbrev 
(drv IN VARCHAR2,
tab IN VARCHAR2,
sch IN VARCHAR2 := NULL)
RETURN VARCHAR2</PRE>

<P><B><I><FONT FACE="Arial" SIZE="2"><A NAME="Automatic">Automatic Invalid
Identifier Correction</A></FONT></I></B></P>
<P><FONT SIZE="2">In release 1.0 of PL/Generator, the generated code could
contain identifiers (names of procedures, cursors, etc.) which were invalid
(containing more than 30 characters). You would discover this problem when you
compile your code or by calling the show_invalid_idents procedure in the PLGval
package (which, unfortunately, also had a bug, now fixed).</FONT></P>
<P>In release 1.1, PL/Generator now detects these invalid identifiers and
corrects them as it generates your code. The result is that your generated code
will never have identifiers that are too long (they can still be invalid if you
use invalid characters in your prefixes, suffixes or aliases).</P>
<P>PL/Generator takes three steps when it detects an invalid identifier:</P>
<OL>
</OL>
<OL>
<LI>It replaces the object name with its abbreviation, if an abbreviation has
been provided.</LI>
<LI>It truncates the identifier at a maximum length of 30 characters.</LI>
<LI>It records the fact that it found an invalid identifier.</LI>
</OL>
<DIR>
</DIR>
<DIR>
</DIR>
<P>At the bottom of the package specification generated code, PL/Generator then
also creates a report showing the original invalid identifier, the corrected
identifier, and a description of the purpose of this element in the generated
code. Here is an example of this report:</P>
<PRE>
 /* 
 ||------------------------------------------------------ 
 || PL/Generator Report on Invalid Identifiers 
 || for package te_SALHIST based on salhist 
 ||------------------------------------------------------ 
 || The following list shows those identifiers which 
 || were invalid (usually because the names were too 
 || long). It also shows the corrected name that was 
 || used in the code, as well as a description of the 
 || purpose that code element serves in the package. 
 ||------------------------------------------------------ 
 || Invalid: open_salhist_emp_lookup_all_cur 
 ||   New name: open_salhist_emp_lookup_all_cu 
 ||    Purpose: &quot;Opens cursor returning rows for foreign key&quot; 
 || 
 || Invalid: close_salhist_emp_lookup_all_cur 
 ||   New name: close_salhist_emp_lookup_all_c 
 ||    Purpose: &quot;Closes cursor returning rows for foreign key&quot; 
 || 
 ||------------------------------------------------------ 
 */ </PRE>

<P><FONT SIZE="2">You can then decide if you want to use those names, or if you
want to set an alias to avoid truncation. In the above case, for example, you
could add an identifier in the coding standards screen with name
&quot;salhist_emp_lookup&quot;, formed by &quot;emplu&quot; and a description
of &quot;Abbreviation for employee lookup foreign key&quot;. When you next
generate your code against this table, the open cursor procedure would be named
&quot;open_emplu_all_cur&quot;; since it is less than 30 characters, it would
no longer be truncated.</FONT></P>
<P><B><I><FONT FACE="Arial" SIZE="2"><A NAME="GenDB">Generating to the
Database</A></FONT></I></B></P>
<P><FONT SIZE="2">If you do not want to have to retrieve your generated code
from server-side files, you can now request that the generated code be written
to a database table, rather than to a file. You can then retrieve the code and
write it out to a file on your client-side machine.</FONT></P>
<P>To request writing of code to the database, call the setdrvtrgtype procedure
as shown below:</P>
<PRE>
 PROCEDURE PLGdoir.setdrvsrctype  
    (drv IN VARCHAR2, 
     tab IN VARCHAR2, 
     typ IN INTEGER, 
     sch IN VARCHAR2 := NULL) 
 &nbsp; </PRE>

<P><FONT SIZE="2">where drv is the driver (PLGte.driver if you are performing
table encapsulation), tab is the name of the table or database object to which
the action is applies, sch is the schema to which the action applies and typ is
one of the following named constants:</FONT></P>
<PRE>
 PLGdoir.c_file 
 PLGdoir.c_dbtab </PRE>

<P><FONT SIZE="2">So, for example, if you want to generate code to the database
as the standard for all tables in the SCOTT schema, you would execute this
command:</FONT></P>
<PRE>
 SQL&gt; exec plgdoir.setdrvsrctype  
        (plgte.driver, plgdoir.c_global, PLGdoir.c_dbtab) </PRE>

<P><FONT SIZE="2">The default setting for the Driver Source Type is &quot;to
file&quot;. </FONT></P>
<P>Once this command is COMMITTed to the database, you can generate code from
the screen interface and this new setting would be applied.</P>
<P>If you write code to the database, you must then take the following steps to
move that code to files and compile the code:</P>
<OL>
</OL>
<OL>

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -