Example 1: Invoking a randomizer |
This example shows how an external component returns a random number for a lottery. Each customer booking a reservation automatically gets a free lottery number. The component uses an input parameter to determine between which number and zero a random number must be found. In this example, lottery numbers between 0 and 10000 are returned. The example uses the Travel Agency case .
In the data model, to the RESERVATION table, add a LOTTERY_NO column based on a regular NUMBER(8) domain. Add a constraint:
Set the SQL statement to:
Description of functionalityThe randomizer component returns a random integer between 0 and the input parameter. Code of invoked subprogram
See also |