-
Notifications
You must be signed in to change notification settings - Fork 7
Expand file tree
/
Copy pathutreceq.html
More file actions
148 lines (122 loc) · 5.84 KB
/
Copy pathutreceq.html
File metadata and controls
148 lines (122 loc) · 5.84 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
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<!-- WARNING! This file is generated. -->
<!-- To alter documentation, edit files in src directory -->
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>utRecEq Package</title>
<link rel="stylesheet" href="utplsql.css" type="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 and the utPLSQL Project" />
<meta name="copyright" content="(C) 2000-2005, 2014-2016 Steven Feuerstein, Chris Rimmer, Patrick Barel and the utPLSQL Project" />
</head>
<body>
<div class="purple_bar"><a href="index.html"><img src="utplsql.jpg" alt="utPLSQL logo" /></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$ -->
<h1>utRecEq Package</h1>
<p>This package contains the following procedures and functions:</p>
<table cellspacing="5">
<tr>
<td><a href="#Add">utRecEq.add</a></td>
<td><a href="#Add">Add a record type comparison function</a></td>
</tr>
<tr>
<td><a href="#Compile">utRecEq.compile</a></td>
<td><a href="#Compile">Compile a package's record type comparison functions</a></td>
</tr>
<tr>
<td><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:
</p>
<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>
<p>
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:
</p>
<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>
<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:</p>
<pre>
PROCEDURE compile(pkg_name_in IN ut_package.name%TYPE);
</pre>
<p>
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:</p>
<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>
<p>
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" alt="utPLSQL logo" /></a></div>
<p>
<a href="http://validator.w3.org/check?uri=referer">
<img src="http://www.w3.org/Icons/valid-xhtml10" alt="Valid XHTML 1.0 Strict" height="31" width="88" />
</a>
</p>
<p class="copyright">Copyright © 2000-2005, 2014-2016 <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> and the utPLSQL Project. All rights reserved</p>
</body>
</html>