Assume that a single-row form is created on the Member table and you are using it to enter data in the table. State the steps you would take to create a trigger that will fire and insert the next card number in the member record when the record is saved. Specify the type of trigger you will use and write the trigger code. Assume that a sequence generator already exists.
What will be an ideal response?
- Double-click ‘cardNo’ field in Object Navigator. In the Property Palette window
that opens change the property ‘Required’ under the Data section to ‘No’;
- Drag the field icon, in the Object navigator, to the end of the attributes list;
- Right click the table block icon in Object Navigator;
- Select ‘PL/SQL’ Editor and choose PRE-INSERT trigger from the window that
opens and click OK.
- In the window that opens (PL/SQL Editor window) type the following code:
SELECT Member_Seq.NEXVAL
INTO :Member.cardNo
FROM SYS.dual;
You might also like to view...
A 9-pin serial interface connector.
What will be an ideal response?
A(n) ________ group is an object on a form or report that displays a limited set of alternatives where only one of those choices can be selected at a time
Fill in the blank(s) with correct word
A(n) ________ is predefined structure that contains basic document settings, such as fonts, margins, and available styles
Fill in the blank(s) with correct word
In counting how many numbers there are in a list (which contains only numbers), COUNT() and COUNTA() are both usable. Select one:
a. true b. false