亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關于我們
? 蟲蟲下載站

?? examples.htm

?? Oracle PL/SQL procedure generator (second generator type)
?? HTM
?? 第 1 頁 / 共 3 頁
字號:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2//EN">
 
<HTML>
 
<HEAD>
<TITLE>Examples</TITLE>
<META NAME="GENERATOR" CONTENT="Arachnophilia 3.9"> 
<META NAME="FORMATTER" CONTENT="Arachnophilia 3.9"> 
</HEAD>

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

<DIR>

<IMG SRC="examples.GIF" WIDTH="431" HEIGHT="92"> <HR>
<P><FONT SIZE="5">Table of Contents</FONT></P>
<P> </P>
<UL>
<LI><A HREF="#1"><B>How to use the examples</B></A> </LI>
<LI><A HREF="#2"><B>Create a header for an insert procedure that accepts as IN
arguments every column in a table</B></A> </LI>
<LI><A HREF="#3"><B>Create a function to check for equality between two records
based on the same table %ROWTYPE</B></A> </LI>
<LI><A HREF="#4"><B>Create cursors to query from a table by primary key and
foreign keys</B></A> </LI>
<LI><A HREF="#5"><B>Generate a procedure to write the contents of a particular
table to a file, with column values separated by a delimiter you pass as an
argument</B></A> </LI>
<LI><A HREF="#6"><B>Build a package that transfers the contents of a particular
table-based record through database pipes</B></A> </LI>
<LI><A HREF="#7"><B>Create DROP statements for all the tables and views in your
schema</B></A> </LI>
<LI><A HREF="#8"><B>Defining an Array of Files in a Directory</B></A> </LI>
<LI><A HREF="#9"><B>Create an audit database trigger for updates to tables in
your schema</B></A> </LI>
<LI><A HREF="#10"><B>Create an entire insert procedure that accepts as IN
arguments every column in a table</B></A> </LI>
<LI><A HREF="#11"><B>Customize the PL/Generator Table Encapsulation driver to
generate customized code specific to each table in your schema</B></A> </LI>
<LI><A HREF="#12"><B>Construct procedures to manage your packaged cursors more
easily</B></A> </LI>
<LI><A HREF="#13"><B>Provide a general solution for mutating table problems
with index</B></A> </LI>
<LI><A HREF="#14"><B>Generate HTML documentation for a table</B></A> </LI>
<LI><A HREF="#15"><B>Generate a PL/SQL program that wraps a Java Stored
Procedure </B></A></LI>
</UL>
<HR>
<P><A NAME="1"><B><FONT FACE="Arial" SIZE="5">INTRODUCTION</FONT></B></A></P>
<P>The best way to learn to use CGML is to examine and play around with
examples. This document offers many different &quot;templates&quot; or CGML
scripts that provide a set of instructions to the PL/Generator engine. We call
them templates because they represent in a generic way structures of code that
you want to generate for a specific database object or other data structure you
have identified to PL/Generator. </P>
<P>You can run these templates yourself by taking these steps:</P>
<OL>
<LI>Follow the directions in the section titled &quot;Working with CGML&quot;
to set up your test environment.</LI>
</OL>
<OL>
<LI>For each challenge, copy your CGML file to testCGML.gdr in your default
directory.</LI>
<LI>Run the test.sql script in SQL*Plus. It will display your results on the
screen and also write them to the CGML.tst file.</LI>
</OL>
<P>When you run test.sql, you will be prompted for the name of the table
against which you want to generate your text. You can easily make copies of
this file to run for specific tables or even to avoid the specification of a
database object all together.</P>
<P>Each example proposes a challenge and then offers the CGML Solution (the
CGML commands needed to achieve the goal), a description of the CGML Highlights
(CGML features of note used in the solution) and a Sample of Generated Text (so
you can get a feel for what you should see yourself when you run the script). 
</P>
<HR>
<P><A NAME="2"><B><I><FONT FACE="Arial" SIZE="5">Create a header for an insert
procedure that accepts as IN arguments every column in a
table.</FONT></I></B></A></P>
<P>This procedure would be just one element of a more comprehensive
encapsulation of a table behind a layer of PL/SQL code. This layer gives you
better control over data integrity and improved (consistent) error handling. 
</P>
<P><B><FONT FACE="Arial" SIZE="4">CGML Solution </FONT></B></P>
<P>You will want to obtain the column information from two arrays: pkycol and
nonpkycol (there is not single array for all columns). The following text uses
a loop to scan through the array and construct IN argument syntax. </P>
<PRE>
   # inshdr.gdr
      [STOREIN]CGML.tst
     PROCEDURE insert_row (
      [FOREACH]col[BETWEEN],
         [colname]_in IN [data_type]
      [ENDFOREACH]
         );
</FONT></PRE>

<P>Notice that I construct an IN parameter based on the column name and its
datatype. An even better approach would be to avoid hard-coded datatype
declarations and instead rely on anchored datatypes as follows:</P>
<P></P>
<PRE>   #inshdr2.gdr
      [STOREIN]CGML.tst
      PROCEDURE insert_row (
      [FOREACH]col[BETWEEN],
         [colname]_in IN [objname].[colname]%TYPE
      [ENDFOREACH]
         );</FONT></PRE>

<P><FONT FACE="Arial" SIZE="4"><B>CGML Highlights </B></FONT></P>
<UL>
<LI>The STOREIN command directs output to the desired file.</LI>
<LI>The FOREACH loop goes through each column in the table, using BETWEEN to
add a column between each parameter, except for the last.</LI>
</UL>
<P><B><FONT FACE="Arial" SIZE="4">Sample of Generated Text </FONT></B></P>
<P>Here is the output based on the department table, for both approaches:</P>
<PRE>
   PROCEDURE insert_row (
         department_id_in IN NUMBER,
         name_in IN VARCHAR2,
         loc_id_in IN NUMBER
         );

      PROCEDURE insert_row (
         department_id_in IN department.department_id%TYPE,
         name_in IN department.name%TYPE,
         loc_id_in IN department.loc_id%TYPE
         );</FONT></PRE>

<HR>
<P><A NAME="3"><I><FONT FACE="Arial" SIZE="5"><B>Create a function to check for
equality between two records based on the same table
%ROWTYPE.</B></FONT></I></A></P>
<P>This is a handy example, since PL/SQL does not let you do boolean checks
between records. The following logic is, for example, highly desirable but not
compilable:</P>
<P></P>
<PRE>   DECLARE
         rec1 employee%ROWTYPE;   
        rec2 employee%ROWTYPE;
      BEGIN
         IF rec1 = rec2 /* Only in your dreams! */</FONT></PRE>

<P>Instead, you must compare the values in corresponding fields of each record.
And then, of course, you have to worry about NULL values. It can get
complicated and, for large records, it can get downright tedious. </P>
<P><B><FONT FACE="Arial" SIZE="4">CGML Solution </FONT></B></P>
<P>Here's some CGML that will take care of this problem (for non-object
database tables, anyway!):</P>
<P></P>
<PRE>   #recseq.gdr
      [STOREIN][objname].req
      CREATE OR REPLACE FUNCTION [objname]_recseq (
         rec1 IN [objname]%ROWTYPE, 
         rec2 IN [objname]%ROWTYPE
         )
      RETURN BOOLEAN
   IS
      unequal_records EXCEPTION;
      retval BOOLEAN;
   BEGIN
   [FOREACH]col
      retval := rec1.[colname] = rec2.[colname] OR
         (rec1.[colname] IS NULL AND rec2.[colname] IS NULL);
      IF NOT NVL (retval, FALSE) THEN RAISE unequal_records; END IF;
  [ENDFOREACH]
      RETURN TRUE;
   EXCEPTION
      WHEN unequal_records THEN RETURN FALSE;
   END;
   /</FONT></PRE>

<P><FONT FACE="Arial" SIZE="4">CGML Highlights </FONT></P>
<UL>
<LI>In this STOREIN command, I have even made the name of the output file
change with the name of the table. This comes in handy when you want to avoid
overwriting an existing file and also just generate a whole lot of text for a
variety of tables.</LI>
</UL>
<P><B><FONT FACE="Arial" SIZE="4">Sample of Generated Text </FONT></B></P>
<P>Here is an example of the output from this CGML for the location or loc
table:</P>
<P></P>
<PRE>   CREATE OR REPLACE FUNCTION loc_recseq (
      rec1 IN loc%ROWTYPE,
      rec2 IN loc%ROWTYPE
      )
   RETURN BOOLEAN
   IS
      unequal_records EXCEPTION;
      retval BOOLEAN;
   BEGIN
      retval := rec1.loc_id = rec2.loc_id OR
         (rec1.loc_id IS NULL AND rec2.loc_id IS NULL);
      IF NOT NVL (retval, FALSE) THEN RAISE unequal_records; END IF;

      retval := rec1.regional_group = rec2.regional_group OR
         (rec1.regional_group IS NULL AND rec2.regional_group IS NULL);
         IF NOT NVL (retval, FALSE) THEN RAISE unequal_records; END IF;

         RETURN TRUE;
      EXCEPTION
         WHEN unequal_records THEN RETURN FALSE;
      END;
      /</FONT></PRE>

<P>As you can see, the only way I can get to the RETURN TRUE statement is if
the corresponding fields have matching values or both are NULL.</P>
<P>And I am sure that it is easy for you to see how to extend this to compare
three or even four different records, as you may need.</P>
<HR>
<P><A NAME="4"><B><I><FONT FACE="Arial" SIZE="5">Create cursors to query from a
table by primary key and foreign keys.</FONT></I></B></A></P>
<P>We usually write the same kind of cursors over and over again in our
programs. Get me the row for a given primary key, fetch through all the rows
for a particular foreign key value set, etc. Why not just generate it instead? 
</P>
<P><B><FONT FACE="Arial" SIZE="4">CGML Solution </FONT></B></P>
<P>This solution is a bit long, but it sure is better than writing those
queries again and again!</P>
<P></P>
<PRE>   #cursors.gdr
      [STOREIN][objname].crs
         CURSOR [objname]_bypky 
         IS
            SELECT
            [FOREACH]col[between],  
               [colname] 
            [ENDFOREACH]          
              FROM [objname]
             ORDER BY
      [FOREACH]pkycol[between],
               [colname]
      [ENDFOREACH]
            ;
         CURSOR [objname]_forpky (
      [FOREACH]pkycol[between],
               [colname]_in IN [coldatatype]
      [ENDFOREACH]
            ) 
         IS
            SELECT
            [FOREACH]col[between],  
               [colname] 
            [ENDFOREACH]          
              FROM [objname]
             WHERE
             [FOREACH]pkycol[between] AND
                [colname] = [colname]_in
             [ENDFOREACH]
            ;
      [FOREACH]fky
         CURSOR row_for_[fkyname] (
         [FOREACH]fkycol[between],
               [colname]_in IN [coldatatype]
         [ENDFOREACH]
            )
         IS
            SELECT
         [FOREACH]col[between],  
               [colname] 
         [ENDFOREACH]          
              FROM [objname]
             WHERE
         [FOREACH]fkycol[between] AND 
                [colname] = [colname]_in
         [ENDFOREACH] 
            ;

      [ENDFOREACH]fky</FONT></PRE>

<P><FONT FACE="Arial" SIZE="4">CGML Highlights </FONT></P>
<UL>
<LI>As you can see, I can loop through all the columns in the table, just the
columns in the primary key or just the columns in a particular foreign key. No
matter which loop, I can reference the same database tags [colname] and
[coldatatype].</LI>
<LI>I am taking advantage of nested loops in this example: For each foreign
key, for each column in each foreign key. There is no limitation to the
nestings of loops in CGML.</LI>
<LI>I can place the name of the foreign key directly inside the cursor name to
make sure the resulting cursor is unique. </LI>
</UL>
<P><B><FONT FACE="Arial" SIZE="4">Sample of Generated Text </FONT></B></P>
<P>Here is part of the output from this CGML text for the employee table:</P>
<P></P>
<PRE>      CURSOR employee_bypky
         IS
            SELECT
               employee_id,
               last_name,
               ...
               department_id
              FROM employee
             ORDER BY
               employee_id
            ;

         CURSOR employee_forpky (
               employee_id_in IN number
            )
         IS
            SELECT
               employee_id,
               last_name,
               ...
              FROM employee
             WHERE
                employee_id = employee_id_in
            ;

         CURSOR row_for_EMP_DEPT_LOOKUP (
               department_id_in IN number

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
欧美午夜一区二区| 欧美体内she精视频| 欧美一区二区三区在线| 久久婷婷成人综合色| 亚洲精品高清在线| 国产一区二区三区综合| 在线观看欧美黄色| 中文成人综合网| 捆绑变态av一区二区三区| 色天天综合色天天久久| 久久精品一区四区| 捆绑紧缚一区二区三区视频| 精品国产伦一区二区三区免费| 亚洲va欧美va人人爽| 豆国产96在线|亚洲| 精品99999| 国产iv一区二区三区| 亚洲人成网站在线| 波波电影院一区二区三区| 久久久亚洲国产美女国产盗摄 | 99re6这里只有精品视频在线观看 99re8在线精品视频免费播放 | 国产色91在线| 色综合一个色综合| 国产精品久久久一本精品| 国产成人综合自拍| xf在线a精品一区二区视频网站| 国产成人av一区| 亚洲无人区一区| 欧美高清www午色夜在线视频| 亚洲一二三级电影| 精品国产制服丝袜高跟| 色先锋aa成人| 精品在线亚洲视频| 欧美激情一区二区在线| 国产suv精品一区二区883| 夜夜夜精品看看| 欧美欧美欧美欧美| 热久久免费视频| 亚洲精品一线二线三线无人区| jizzjizzjizz欧美| 蜜臀av一区二区在线免费观看| 91.麻豆视频| 看电视剧不卡顿的网站| 亚洲欧美成人一区二区三区| 日韩午夜激情免费电影| 国产精品一区在线| 国产精品色哟哟| 日韩欧美国产一区二区在线播放| 精品一区精品二区高清| 亚洲综合丁香婷婷六月香| 9191成人精品久久| 色噜噜久久综合| 蜜臀av一区二区| 亚洲国产欧美日韩另类综合 | av动漫一区二区| 国产在线精品免费| 午夜精品一区二区三区免费视频| 欧美精品少妇一区二区三区 | 国产高清一区日本| 蜜芽一区二区三区| 亚洲韩国精品一区| 亚洲精品成人少妇| ...av二区三区久久精品| 91黄色免费观看| 99视频有精品| 99国产精品久久久久久久久久 | 色视频欧美一区二区三区| 风间由美性色一区二区三区| 激情综合五月婷婷| 免费看精品久久片| 日韩电影一区二区三区四区| 久久久久久久久97黄色工厂| 91精品国产色综合久久不卡蜜臀| 欧美无砖专区一中文字| 色88888久久久久久影院野外| av资源站一区| 波多野结衣在线aⅴ中文字幕不卡| 一区二区免费在线播放| 1000精品久久久久久久久| 国产精品你懂的在线| 中文字幕成人av| 国产精品五月天| 亚洲桃色在线一区| 久久综合狠狠综合| 久久一二三国产| 国产欧美日韩激情| 91精品国产综合久久久久久久 | 日韩精品中文字幕在线一区| 欧美一卡二卡三卡| 欧美xfplay| 欧美精品在线观看播放| 51午夜精品国产| 欧美成人精品二区三区99精品| 日韩视频国产视频| 国产亚洲成年网址在线观看| 国产精品毛片久久久久久久| 国产精品久久久久精k8| 亚洲一区av在线| 日韩中文字幕亚洲一区二区va在线| 中文字幕在线视频一区| 亚洲日韩欧美一区二区在线| 亚洲电影你懂得| 麻豆成人久久精品二区三区小说| 精品在线亚洲视频| 91在线精品一区二区三区| 欧美视频一区二区| 精品国产凹凸成av人网站| 国产欧美精品一区| 亚洲柠檬福利资源导航| 蜜臀精品一区二区三区在线观看| 精品一区二区三区影院在线午夜| caoporen国产精品视频| 91精品国产色综合久久不卡蜜臀| 国产婷婷色一区二区三区在线| 一区二区三区四区不卡视频| 九色porny丨国产精品| proumb性欧美在线观看| 欧美日韩国产片| 欧美精品一区二区三区蜜桃| 亚洲美女淫视频| 黄色精品一二区| 国产伦精品一区二区三区免费 | 国产精品午夜春色av| 亚洲成人中文在线| 粉嫩高潮美女一区二区三区| 欧美日韩国产免费| 国产精品久线在线观看| 男人的j进女人的j一区| 91视频观看免费| 色呦呦一区二区三区| 日韩免费视频一区| 亚洲国产精品影院| 成人晚上爱看视频| 色综合中文字幕国产 | 国产乱理伦片在线观看夜一区| 91成人免费在线| 日本一区二区高清| 美洲天堂一区二卡三卡四卡视频| 91啦中文在线观看| 国产精品九色蝌蚪自拍| 国产真实乱偷精品视频免| 欧美日韩欧美一区二区| 日韩一区二区视频在线观看| 亚洲青青青在线视频| 国产激情一区二区三区| 欧美一区二区三区免费视频| 有码一区二区三区| 成人性生交大片免费看中文网站| 精品第一国产综合精品aⅴ| 亚洲成人黄色影院| 欧美性猛片aaaaaaa做受| 国产精品久久久久久久午夜片| 国内精品写真在线观看| 欧美一区日韩一区| 亚洲18影院在线观看| 一本大道av一区二区在线播放| 国产精品国产三级国产| 国产传媒日韩欧美成人| 2023国产精品自拍| 久久99久久99小草精品免视看| 91精品免费在线观看| 亚洲资源中文字幕| 欧美亚洲免费在线一区| 亚洲精品网站在线观看| 91美女在线观看| 一区二区三区中文字幕| 99re8在线精品视频免费播放| 国产精品久久久久久久久搜平片| 国产高清在线精品| 国产精品美女久久久久久久网站| 国产精品一区二区在线看| 久久这里只有精品首页| 国产麻豆视频一区二区| 国产精品欧美久久久久无广告| 成人ar影院免费观看视频| 国产精品乱码人人做人人爱 | 亚洲激情自拍视频| 欧美熟乱第一页| 日韩国产欧美在线视频| 91麻豆精品国产91久久久使用方法| 日韩成人一区二区三区在线观看| 欧美一区二区精品| 激情欧美一区二区三区在线观看| 久久综合久色欧美综合狠狠| 国产99一区视频免费| 亚洲色图制服丝袜| 欧美无砖专区一中文字| 蜜桃视频一区二区三区| 久久亚洲影视婷婷| eeuss国产一区二区三区| 亚洲成人av中文| 日韩三级av在线播放| 风间由美一区二区av101 | 99精品久久99久久久久| 一区二区在线电影| 在线综合视频播放| 国产精品一区免费在线观看| 亚洲视频电影在线| 日韩欧美一区二区久久婷婷| 懂色中文一区二区在线播放|