forked from KenRoytman/utPLSQL
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathutreceq.html
More file actions
executable file
·116 lines (92 loc) · 5.07 KB
/
Copy pathutreceq.html
File metadata and controls
executable file
·116 lines (92 loc) · 5.07 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
<!doctype html public "-//w3c//dtd html 4.0 transitional//en">
<!-- WARNING! This file is generated. -->
<!-- To alter documentation, edit files in src directory -->
<html><head>
<title>utRecEq Package</title>
<link rel="stylesheet" href="utplsql.css" content="text/css">
<meta name="keywords" content="utPLSQL, PL\SQL, Unit Testing, Framework, Oracle"/>
<meta name="description" content="Unit Testing PL\SQL"/>
<meta name="title" content="utRecEq Package"/>
<meta name="author" content="Steven Feuerstein, Chris Rimmer, Patrick Barel"/>
<meta name="copyright" content="(C) 2000-2005 Steven Feuerstein, Chris Rimmer, Patrick Barel"/>
</head><body>
<div class="purple_bar"><a href="index.html"><img src="utplsql.jpg" border=0></a></div>
<p>[ <A href="index.html">Home</A>
| <A href="started.html">Getting Started</A>
| <A href="buildpack.html">Build Test Packages</A>
| <A href="examples.html">Examples</A>
| <A href="userguide.html">User Guide</A>
| <A href="release.html">Release Notes</A>
| <A href="map.html">Document Map</A> ]</p>
<p><A href="utoutput.html">< Previous Section: utOutput Package</A> | <A href="defsuite.html">Next Section: Defining Test Suites ></A></p>
<!-- Begin utPLSQL Body -->
<!-- $Id: utreceq.html,v 1.1 2002/07/31 15:48:37 chrisrimmer Exp $ -->
<h1>
utRecEq Package
</h1>
<p>This package contains the following procedures and functions:
<br>
<table cellspacing="5">
<tr>
<tr>
<td width="25%"><a href="#Add">utRecEq.add</a></td>
<td><a href="#Add">Add a record type comparison function</a></td>
</tr>
<tr>
<td width="25%"><a href="#Compile">utRecEq.compile</a></td>
<td><a href="#Compile">Compile a package's record type comparison functions</a></td>
</tr>
<tr>
<td width="25%"><a href="#Rem">utRecEq.rem</a></td>
<td><a href="#Rem">Remove record type comparison functions</a></td>
</tr>
</table>
<h2><a name="Add"></a>Generate functions to compare record types</h2>
<p>This package (created by Dan Spencer) allows the creation of functions to
allow the comparison of record types based on tables or views (%ROWTYPE
records in other words). They are generated by the add procedure:
<pre>PROCEDURE add(
pkg_name_in IN ut_package.name%TYPE,
record_in IN ut_receq.name%TYPE,
rec_owner_in IN ut_receq.created_by%TYPE := USER
);</pre>
The pkg_name_in parameter contains the name of a tested package you wish to
associate with this record type. Note that this package name should already
exist in the ut_package table. The record_in parameter contains the name of
the view or table whose record type is to be compared. The final (optional)
parameter contains the name of the schema in which the table or view exists.
It defaults to the current user.</p>
<p>The generated function will be named EQ_{Record_Schema_}Record_Name. The
schema is only inserted when the record type is not within the current one. The
function will return TRUE if the two records are identical on a field-by-field
comparison and FALSE otherwise. Note that NULL fields are considered
equal.</p>
<p>The details of the EQ_* functions and their association with tested packages held in two tables:
<ul>
<li>UT_RECEQ - This table holds a list of the EQ_* functions including the
target table/view and the schema in which it is found.</li>
<li>UT_RECEQ_PKG - This table cross-references the tested packages against the functions listed in UT_RECEQ.</li>
</ul></p>
<h2><a name="Compile"></a>Compile a package's record comparison functions</h2>
<p>This routine recompiles all the EQ_* functions associated with a given package:
<pre>PROCEDURE compile(pkg_name_in IN ut_package.name%TYPE);</pre>
when <a href="utconfig.html#Autocompile">autocompiling</a> is turned on, this is called by
utplsql.test or utplsql.testsuite before the test packages themselves are recompiled.</p>
<h2><a name="Rem"></a>Remove record comparison functions</h2>
<p>To remove record comparison functions, use the following:
<pre>PROCEDURE rem(
name_in IN ut_receq.name%TYPE,
rec_owner_in IN ut_receq.created_by%TYPE := USER
for_package_in IN BOOLEAN := FALSE
);</pre>
If for_package_in is FALSE, then name_in is taken to refer to a record type to
remove, with rec_owner_in specifying the schema the record type is in. All package associations for this record type are removed and the EQ_* function is dropped.</p>
<p>On the other hand, if for_package_in is TRUE, then name_in is taken to refer
to a package. In this case, all the package's associations are removed. If no
other package is associated with a given record, then the EQ_* function is
dropped. (Note that the rec_owner_in parameter is ignored here).</p>
<!-- End utPLSQL Body -->
<p><A href="utoutput.html">< Previous Section: utOutput Package</A> | <A href="defsuite.html">Next Section: Defining Test Suites ></A></p>
<div class="purple_bar"><a href="index.html"><img src="utplsql.jpg" border=0></a></div>
<p class="copyright">Copyright (C) 2000-2005 <A href="mailto:steven@stevenfeuerstein.com">Steven Feuerstein<A>, <A href="mailto:c@24.org.uk">Chris Rimmer<A>, <A href="mailto:pbarel@vda.nl">Patrick Barel<A> All rights reserved</p>
</body></html>