Copyright © TIBCO Software Inc. All Rights Reserved
Copyright © TIBCO Software Inc. All Rights Reserved


Chapter 6 Manipulating Data in a Table : Inserting Data

Inserting Data
Inserting Data Using the I Line Command in the Table Editor
The line command I creates a new occurrence or multiple occurrences. It is the only line command that can be used on the top line command field. To use the line command I to insert data, complete the following tasks:
1.
You can type I in multiple line command fields at once.
2.
A new occurrence is created below the selected one. The cursor is positioned in the first column of the primary key field, indicated by the ampersand (&).
3.
4.
5.
Inserting Data Using PF4 in the Table Editor
To use PF4 to insert a new line, complete the following tasks:
1.
2.
A new occurrence is created below the selected one, indicated by the ampersand (&).
3.
4.
5.
Inserting Data Using the Single Occurrence Editor
To insert an occurrence from the Single Occurrence Editor, complete the following tasks:
1.
This invokes the Single Occurrence Editor.
2.
3.
This clears all the existing data from the occurrence.
4.
5.
Repositioning of Data
If used from the Table Browser, the new occurrence is inserted in its correct position based on the primary key as soon as you save from the Single Occurrence Editor. If used from the Table Editor, the new occurrence is first inserted after the selected occurrence and repositioned after you save from the Table Editor.
Inserting Data Using a Rules Statement
To insert data with a rules statement, use the INSERT statement. You can use a WHERE clause to select a table instance. You cannot insert an occurrence into a table if the primary key value for the occurrence already exists; you must delete the occurrence first using the DELETE statement.
Example of Inserting Data
The following example illustrates a rule that inserts data:

 
RULE EDITOR ===> SCROLL: P
INSERT_EMPLOYEE(REGION, EMPNO);
_
_ ---------------------------------------------------------------------------
_ ------------------------------------------------------------+--------------
_ FORALL @EMPLOYEES WHERE REGION = REGION: | 1
_ @EMPLOYEES.EMPNO = EMPNO ; |
_ INSERT @EMPLOYEES WHERE REGION = REGION; |
_ END ; |
_ ---------------------------------------------------------------------------

 
This rule:
1.
2.
3.
See Also
TIBCO Object Service Broker Programming in Rules for information on commits, the use of rules, and the INSERT and DELETE statements.

Copyright © TIBCO Software Inc. All Rights Reserved
Copyright © TIBCO Software Inc. All Rights Reserved