8.2. Setting a Variable Default
The first place to use PL/SQL within your application is to set a default value for a new column in the database. You will have to use procedural logic to set this default, since the value of the default changes, depending on the value of fields in the page.
Way back in Chapter 4, you added a default value for the ORDER_TIMESTAMP column. In this section, you will add a new field to the ORDERS table to hold the promised ship date and then create logic to calculate what this ship date should be.
Try It Out: Adding a New ColumnYour first task will be to add a new column to the ORDERS table to hold the ship date.
Now that you have a new column in the table, you will have to add an item to the page to display the value.
|
Get Beginning Oracle® Application Express 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.