Skip to Main Content
Oracle PL/SQL Programming: A Developer's Workbook
book

Oracle PL/SQL Programming: A Developer's Workbook

by Steven Feuerstein, Andrew Odewahn
May 2000
Intermediate to advanced content levelIntermediate to advanced
594 pages
11h 32m
English
O'Reilly Media, Inc.
Content preview from Oracle PL/SQL Programming: A Developer's Workbook

Expert

28-33.

In 28-32, you correctly encoded a parameter’s value because you already knew its format. This is usually not the case. Write a general function that can encode any string into CGI (Common Gateway Interface) format. Test your function using the value “The date {05/21/1994}”. It should return the string “the+date+%7B05%2F21% 2F1994%7D”.

28-34.

Your company uses an online system that allows employees to fill out expense reports, which are stored in a table. At the end of each month, there are usually several thousand records. On May 1st, the Payables department asks you to write a system to monitor employee expenses, and you dutifully comply by writing a PL/SQL procedure. Everything works fine. On May 21st, you start receiving complaints that the system is “slow,” and the next week you receive a call that it has blown up entirely, displaying the message “Internal Error.” What might be happening, and how can you fix the problem?

28-35.

A programmer has written the following procedure:

CREATE OR REPLACE PROCEDURE foo AS
    x NUMBER DEFAULT 1;
  BEGIN
    LOOP
       EXIT WHEN x = 0;
       x := x + 1;
      IF x > 100 THEN
         x := 1;
      END IF;
   END LOOP;
   HTP.PRINT('All done!');
END;

When the programmer calls it from the Web, the browser simply hangs and never returns the expected output. He presses the “Stop” button and rechecks the code. After finding the bug that caused the program to hang, he attempts to recompile the procedure. This time, the compiler itself hangs for several minutes. Eventually, it returns ...

Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

Oracle Database 12c PL/SQL Programming

Oracle Database 12c PL/SQL Programming

Michael McLaughlin
Oracle PL/SQL for DBAs

Oracle PL/SQL for DBAs

Arup Nanda, Steven Feuerstein
Oracle PL/SQL For Dummies

Oracle PL/SQL For Dummies

Michael Rosenblum, Paul Dorsey

Publisher Resources

ISBN: 9781449324070Supplemental ContentErrata Page