2-3. Declaring Variable Types That Match Column Types

Problem

You want to declare some variables in your code block that match the same datatypes as some columns in a particular table. If the datatype on one of those columns changes, you'd like the code block to automatically update the variable type to match that of the updated column.

Image Note Sharp-eyed readers will notice that we cover this problem redundantly in Chapter 1. We cover this problem here as well, because the solution is fundamental to working in PL/SQL, especially to working with SQL in PL/SQL. We don't want you to miss what we discuss in this recipe. It is that important.

Solution ...

Get Oracle and PL/SQL Recipes: A Problem-Solution Approach now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.