q=category/section/learn

learn

  • feed_items
  • block_1

Listing 6

in

Listing 6. This procedure encapsulates the DBMS_OUTPUT.PUT_LINE procedure to make it more useful and user-friendly.

PROCEDURE cc_util.pl (str IN VARCHAR2, len IN INTEGER := 80)
IS
v_len PLS_INTEGER := LEAST (len, 255);
v_len2 PLS_INTEGER;
v_chr10 PLS_INTEGER;
BEGIN
IF LENGTH (str) > v_len
THEN
v_chr10 := INSTR (str, CHR (10));

Listing 5.

in

Listing 5. This function encapsulates the DBMS_UTILITY.NAME_RESOLVE procedure to make it easier to use.

Listing 4.

in

Listing 4. This wordy code is replaced, in the call to report an ambiguous overloading, by the handy function cc_util.ifelse.

DECLARE
l_start1 PLS_INTEGER;
l_start2 PLS_INTEGER;
BEGIN
IF l_numargs1 = 0
THEN
l_start1 := 0;
ELSE
l_star21 := 1;
END IF;

IF l_numargs2 = 0
THEN
l_start2 := 0;
ELSE
l_start2 := 1;
END IF;

Listing 3: This procedure retrieves results from the results table.

in

Listing 3. This procedure retrieves results from the results table.

Listing 2: This procedure initializes the results table.

in

Listing 2. This procedure initializes the results table.

Part 7: Crafting Service Providers: Creating a Versatile Reporting Package

in

PL/SQL

Crafting Service Providers: Creating a Versatile Reporting Package
Installment 7 of Feuerstein's "Building a Code-Analysis Utility" series

by Steven Feuerstein

The reporting package for the OverloadCheck utility demonstrates useful techniques for creating efficient, easy-to-maintain code.

Listing 5: The load_in_same_family program

in

Listing 5: The load_in_same_family program

Listing 4: The load_permutations program

in

Listing 4: The load_permutations program

1 PROCEDURE load_permutations (
2 val1_in IN PLS_INTEGER
3 ,val2_in IN PLS_INTEGER
4 )
5 IS
6 BEGIN
7 type_families (val1_in) (val1_in) := TRUE;
8 type_families (val2_in) (val2_in) := TRUE;
9 type_families (val1_in) (val2_in) := TRUE;
10 type_families (val2_in) (val1_in) := TRUE;
11 END;

Listing 2: The steps of the main executable section of fullset

in

Listing 2: The steps of the main executable section of fullset

Listing 1: Creation of the record TYPE

in

Listing 1: Creation of the record TYPE

Syndicate content