Skip to Content
Advanced Oracle PL/SQL Programming with Packages
book

Advanced Oracle PL/SQL Programming with Packages

by Steven Feuerstein
October 1996
Intermediate to advanced
687 pages
16h 41m
English
O'Reilly Media, Inc.
Content preview from Advanced Oracle PL/SQL Programming with Packages

3.4. Improving the User Interface

A couple of weeks go by before I encounter another need for twice. Then I need to call it for lower-UPPER conversion on a company name. So I put this line in my program:

v_full_name := twice (comp_rec.short_name, 'lu');

but when I execute the program, the full name is not in lower-UPPER format. It is all uppercased and, as I trace my way back to the data, that is just how the company short name is stored in the database. It doesn't seem to be doing any conversion at all.

Frustrated, I decide to head back to the source code. Of course, I can't remember where I stored the source code on disk. It was just a dinky little program. And it's generally not too easy to view the source code as it exists in the USER_SOURCE data dictionary view. Fortunately, I have built a PL/Vision package named PLVvu (more about this in Chapter 14) to view the code and so I execute that program to refresh my memory:

SQL> exec PLVvu.code('twice'); ----------------------------------------------------------- Code for FUNCTION TWICE ----------------------------------------------------------- Line# Source ----------------------------------------------------------- 1 FUNCTION twice 2 (string_in IN VARCHAR2, action_in IN VARCHAR2) 3 RETURN VARCHAR2 4 IS 5 BEGIN 6 IF action_in = 'UL' 7 THEN 8 RETURN (UPPER (string_in) || LOWER (string_in)); 9 ELSIF action_in = 'LU' 10 THEN 11 RETURN (LOWER (string_in) || UPPER (string_in)); 12 ELSIF action_in = 'N' 13 THEN 14 RETURN string_in ...
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
Expert PL/SQL Practices for Oracle Developers and DBAs

Expert PL/SQL Practices for Oracle Developers and DBAs

John Beresniewicz, Adrian Billington, Martin Büchi, Melanie Caffrey, Ron Crisco, Lewis Cunningham, Dominic Delmolino, Sue Harper, Torben Holm, Connor McDonald, Arup Nanda, Stephan Petit, Michael Rosenblum, Robyn Sands, Riyaj Shamsudeen

Publisher Resources

ISBN: 1565922387Supplemental ContentCatalog PageErrata