IBM SG24-6320-00 Manuale Utente

Pagina di 306
 Chapter 10. Pre-migration steps 
195
Draft Document for Review July 28, 2004 7:33 pm
6320ch_before_migration.fm
In our example we only had one catalog which did not comply with the 
restrictions set for a master catalog as it had items, which belonged to more than 
one category. This meant that we had to create a new master catalog and use 
the existing catalog as a sales catalog. 
To create a master catalog we performed these steps:
1. Create catalog
insert into catalog values (10002,-2000,'Master Catalog','Master Catalog')
2. Create catalog description
insert into catalogdsc values (10002,-1,'Master 
Catalog',NULL,NULL,NULL,NULL)
3. Create category (catalog group)
insert into catgroup values ((select max(catgroup_id) from 
catgroup)+1,-2000,'Master Category',0,NULL,NULL,NULL,NULL)
4. Create category description (catalog group description)
insert into catgrpdesc (catgroup_id,language_id, name, published, 
shortdescription) values ((select max(catgroup_id) from 
catgroup),-1,'Master Category',1,'Master Category description')
5. Create relation between catalog and category
insert into cattogrp values (10002,(select max(catgroup_id) from catgroup))
6. Create relation between store and catalog
insert into storecat values (10001,10001)
insert into storecat values (10002,10001)
7. Create relation between store and category (catalog group)
insert into storecgrp values (10001,(select max(catgroup_id) from 
catgroup))
8. Create relation between all catalog entries and category
insert into catgpenrel(catgroup_id, catalog_id, catentry_id, rule, 
sequence) select (select max(catgroup_id) from catgroup), 10002, 
catentry_id, '-', 0.0 from catentry
9. Update keys for catalog
update keys set counter=(select max(counter) from keys where 
tablename='catalog')+1 where tablename='catalog'
10.Update keys for category
Note: The existing catalog (10001) was missing in STORECAT table, so 
we added it manually