Oracle PL/SQL Programming
Steven Feuerstein, Bill Pribyl
Format: PDF / Kindle (mobi) / ePub
Considered the best Oracle PL/SQL programming guide by the Oracle community, this definitive guide is precisely what you need to make the most of Oracle’s powerful procedural language. The sixth edition describes the features and capabilities of PL/SQL up through Oracle Database 12c Release 1.
Hundreds of thousands of PL/SQL developers have benefited from this book over the last twenty years; this edition continues that tradition. With extensive code examples and a lively sense of humor, this book explains language fundamentals, explores advanced coding techniques, and offers best practices to help you solve real-world problems.
- Get PL/SQL programs up and running quickly, with clear instructions for executing, tracing, testing, debugging, and managing code
- Understand new 12.1 features, including the ACCESSIBLE_BY clause, WITH FUNCTION and UDF pragma, BEQUEATH CURRENT_USER for views, and new conditional compilation directives
- Take advantage of extensive code samples, from easy-to-follow examples to reusable packaged utilities
- Optimize PL/SQL performance with features like the function result cache and Oracle utilities such as PL/Scope and the PL/SQL hierarchical profiler
- Build modular, easy-to-maintain PL/SQL applications using packages, procedures, functions, and triggers
IN 1 .. colcnt LOOP IF desctab (indx).col_type = 2 THEN DBMS_SQL.define_column (curid, indx, numvar); ELSIF desctab (indx).col_type = 12 THEN DBMS_SQL.define_column (curid, indx, datevar); ELSE DBMS_SQL.define_column (curid, indx, namevar, 100); END IF; END LOOP; WHILE DBMS_SQL.fetch_rows (curid) > 0 LOOP FOR indx IN 1 .. colcnt LOOP DBMS_OUTPUT.put_line (desctab (indx).col_name || ' = '); IF desctab (indx).col_type = 2 THEN DBMS_SQL.COLUMN_VALUE (curid, indx, numvar); DBMS_OUTPUT.put_line (' '
intruder updates the main data, calculates the hash value as well, and updates the stored hash value? To protect against that possibility, you can create a kind of password-protected hash value, known as a message authentication code (MAC). A MAC is a hash value combined with a key. If you use a different key, the same input data will produce a different MAC. As with a hash, you can’t decipher the main data from the MAC; it is one-way encryption. The presence of the key makes it impossible for
executing its body? When the test for termination takes place Does the test for termination take place at the beginning or end of the loop? What are the consequences? Reason to use this loop What are the special factors you should consider to determine if this loop is right for your situation? Loop Basics Why are there three different kinds of loops? To provide you with the flexibility you need to write the most straightforward code to handle any particular situation. Most
face the intimidating details of parameter mapping. Parameter Mapping: The Full Story As shown in the previous section, when you are moving data between PL/SQL and C, each PL/SQL datatype maps to an external datatype, identified by a PL/SQL keyword, which in turn maps to an allowed set of C types. You identify an external datatype in the PARAMETERS clause with a keyword known to PL/SQL. In some cases, the external datatypes have the same names as the C types, but in others they don’t.
primary key or name. Display problem and re-raise. DBMS_OUTPUT.put_line ( 'Company ID or name already in use. ID = ' || TO_CHAR (id_in) || ' name = ' || name_in ); RAISE; WHEN −2291 THEN -- Parent key not found for type. Display problem and re-raise. DBMS_OUTPUT.put_line ( 'Invalid company type ID: ' || TO_CHAR (type_id_in)); RAISE; ELSE RAISE; END CASE; END; -- End of anonymous block. END add_company; You should use WHEN OTHERS with care, because it can easily “swallow up” errors and hide them