IBM Mainframe Forum Index
 
Log In
 
IBM Mainframe Forum Index Mainframe: Search IBM Mainframe Forum: FAQ Register
 

CoolGen Relationship Action


IBM Mainframe Forums -> CA Products
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
Mr.Niceguy

New User


Joined: 16 Jun 2005
Posts: 63

PostPosted: Wed Nov 04, 2009 6:20 pm
Reply with quote

Hi All,

Can anybody explain the relationship action in CoolGen

(i) Associate (ii) Disassociate and (iii) Transfer with some examples?

It would be really helpful.

Thanks in advance.
Back to top
View user's profile Send private message
Bharath Bhat

Active User


Joined: 20 Mar 2008
Posts: 283
Location: chennai

PostPosted: Thu Nov 26, 2009 4:03 pm
Reply with quote

ASSOCIATE

Relationship actions appear as clauses in CREATE or UPDATE action statements. Specifically, ASSOCIATE can appear as a clause in either CREATE or UPDATE action statements. ASSOCIATE can also appear as a stand-alone relationship action. ASSOCIATE has no exception conditions, but its stand-alone form may have database exception conditions.

When you CREATE an entity, you must build its identifying relationship memberships using an ASSOCIATE. The entity being associated must be one the action diagram recognizes through a CREATE or READ. ASSOCIATE establishes a pairing along a relationship between two entities. You may ASSOCIATE entities when the relationship is optional, and you must ASSOCIATE them (before the end of the elementary process) when the relationship is mandatory.

ex. emp table and emp_dept table.
wheneve you create a row in emp table, you need to associate it with emp_dept table for some department.
Back to top
View user's profile Send private message
Bharath Bhat

Active User


Joined: 20 Mar 2008
Posts: 283
Location: chennai

PostPosted: Thu Nov 26, 2009 4:05 pm
Reply with quote

DISASSOCIATE

Relationship actions appear as clauses in CREATE or UPDATE action statements. DISASSOCIATE can also appear as:

Clauses in UPDATE action statements

Stand-alone relationship action

DISASSOCIATE has no exception conditions, but its stand-alone form may have database exception conditions.

You can DISASSOCIATE entities whose relationships have been designated as optional. The DISASSOCIATE action breaks a specific pairing along a specific relationship.

DISASSOCIATE can appear as a clause in an UPDATE action statement or as a stand-alone relationship action like ASSOCIATE. It operates exactly the same as the relationship clauses in the CREATE and UPDATE, with one exception. In relationship clauses, the subject of the clause is always the subject of the entity action. In a stand-alone relationship action, you must explicitly specify the subject of the action.

An example of a stand-alone DISASSOCIATE relationship action is shown below. In this example, received product will be deleted if its relationship to order_line is mandatory and has a cardinality of one. In addition, any product components dependent on that occurrence of PRODUCT will be deleted.

--DISASSOCIATE received product

| FROM order_line WHICH contains IT

--

In the example below, the relationship between PRODUCT and WAREHOUSE in the data model still exists. The pairing between the two specific entities does not. DISASSOCIATE can appear as a clause in an UPDATE action statement (as shown here).

--UPDATE received product

| SET number_delivered TO input product number_delivered

| DISASSOCIATE FROM warehouse WHICH can hold IT

--
Back to top
View user's profile Send private message
Bharath Bhat

Active User


Joined: 20 Mar 2008
Posts: 283
Location: chennai

PostPosted: Thu Nov 26, 2009 4:06 pm
Reply with quote

TRANSFER

Relationship actions appear as clauses in CREATE or UPDATE action statements. TRANSFER can also appear as a stand-alone relationship action. TRANSFER has no exception conditions, but its stand-alone form may have database exception conditions.

You can TRANSFER relationships defined as transferable in the data model. The TRANSFER action transfers the relationship between specific entity occurrences. You are changing the pairing from one entity to another. This action does not affect the relationship between entities in the data model. You must READ or CREATE the entity before you TRANSFER the relationship.

For example, consider a warehouse that holds products. Products can be moved from one warehouse to another. In the example below, PRODUCT has been moved from one PROCESSING WAREHOUSE to NEW WAREHOUSE. The relationship between WAREHOUSE and PRODUCT is represented in the data model as PRODUCT always is held in one WAREHOUSE and WAREHOUSE sometimes holds one or more PRODUCT. The relationship is defined as transferable and is not changed in the data model.

-- TRANSFER received product
| FROM processing warehouse WHICH holds IT
| TO new warehouse WHICH holds IT
Back to top
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic View Bookmarks
All times are GMT + 6 Hours
Forum Index -> CA Products

 


Similar Topics
Topic Forum Replies
No new posts COOLGEN - DB2. -927 error while initi... DB2 8
No new posts COOLGEN - TSO TEST FACILITY CA Products 4
No new posts What's the relationship between DB2 t... DB2 7
No new posts Coolgen Materials Needed CA Products 1
No new posts Compare two tables and populate Actio... DB2 13
Search our Forums:

Back to Top