Jerry Fochtman wrote
>>> Jerry Fochtman <[log in to unmask]> 02/04/98
07:37am >>>
Paolo Tealdi <[log in to unmask]> wrote:
>I've a database on Turbo Image (i'm new with this database ...)
>i have to put a new field in an existing table. No problem !
>i put it at the end of the table and do an DBUNLOAD-DBLOAD.
>Now I have to index this new field. How can i do ?
>I can't put the AUTOMATIC MASTER at the end of the DBSTEXT ,
>because when DBSCHEMA finds the definition it just send me an error
>because there isn't (still) a relation with an AUTOMATIC.
>I can't put before the incriminated table because DBLOAD
>gets angry and do pitoresque things!
>I think that there must be a solution, and simple, but i can't
>find it. :-((
>Anybody can help me ?
IMAGE requires that a master set be defined in the schema file
prior to any detail sets which it serves as a key. You should
be able to DBUNLOAD the base, insert the set in the schema in
the proper place and re-build the base, then DBLOAD it without
any problems.
The UNLOAD/LOAD technique provided by HP requires that items be
added to the end of existing datasets. However, it places
dataset information in the data it unloads from the base so it
can place the data back in the same set when doing the load.
As such, there shouldn't be any problem inserting a new set to the
base providing its is a new name. And because it is an auto-
master, when the entries are placed in the corresponding detail
during the DBLOAD, the search paths will also be established
for the new auto-master.
------------------------------------------------------------------------------------
Sorry, but the above fix won't work. DBUNLOAD might put set
information on the tape, but DBLOAD doesn't use it. It uses set numbers
not name, so you cannot insert a master in front of a detail for index
purposes and user DBUNLOAD/DBLOAD to make the change. Here is an
example of what happens when a set is inserted before another
.
:RUN QUERY.PUB.SYS
HP32216N.03.11 QUERY/NM THU, FEB 5, 1998, 7:09 AM
COPYRIGHT HEWLETT-PACKARD CO. 1976
>B=TEST
PASSWORD = >>
MODE = >>1
>FO SETS
DATA BASE: TEST THU, FEB 5, 1998, 7:09 AM
DATA BASE LANGUAGE ATTRIBUTE: NATIVE-3000
ITEM CURRENT ENTRY ENTRY BLOCKING
SETS: TYPE COUNT CAPACITY COUNT LENGTH FACTOR
DET D 4 114 1 10 38
>LIST DET
F1 F2 F3 F4
12 1234 123456 12345678
>E
END OF PROGRAM
:RUN DBUNLOAD.PUB.SYS
HP30391C.06.22 TurboIMAGE/XL : DBUNLOAD (C) COPYRIGHT
HEWLETT-PACKARD CO. 1987
WHICH DATABASE? TEST
DATA SET 1: 1 entries expected, 1 entries processed.
END of volume 1, 0 write errors recovered.
Save volume on logical device 7 as 1.
Database UNLOADED.
END OF PROGRAM
:RUN DBUTIL.PUB.SYS,PURGE
Database name:TEST
Database has been PURGED.
END OF PROGRAM
:FILE DBSTEXT=TESTSK
:RUN DBSCHEMA.PUB.SYS;PARM=1
PAGE 1 HEWLETT-PACKARD 30391C.06.05 TurboIMAGE/3000:
DBSCHEMA
THU, FEB 5, 1998, 7:11 AM (C) HEWLETT-PACKARD CO. 1987
BEGIN DATABASE TEST;
PASSWORDS:
ITEMS:
F1, X2;
F2, X4;
F3, X6;
F4, X8;
SETS:
NAME: NEW,D;
ENTRY: F4; << note new set #1 inserted before old #1 >>
CAPACITY: 20;
NAME: DET,D;
ENTRY: F1,
F2,
F3,
F4;
CAPACITY: 100;
END.
DATA SET TYPE FLD PT ENTR MED MAXIMUM BLK BLK DISC
NAME CNT CT LGTH REC CAPACITY FAC LGTH SPACE
NEW D 1 0 4 4 20 20 82 16
DET D 4 0 10 10 114 38 383 16
TOTAL DISC SECTORS INCLUDING ROOT: 48
NUMBER OF ERROR MESSAGES: 0
ITEM NAME COUNT: 4 DATA SET COUNT: 2
ROOT LENGTH: 648 BUFFER LENGTH: 383 TRAILER LENGTH: 256
ROOT FILE TEST CREATED.
END OF PROGRAM
:RUN DBUTIL.PUB.SYS,CREATE
Database name:TEST
Database TEST has been CREATED.
END OF PROGRAM
:RUN DBLOAD.PUB.SYS
HP30391C.06.22 TurboIMAGE/XL :DBLOAD (C) COPYRIGHT
HEWLETT-PACKARD COMPANY 1987
WHICH DATABASE? TEST
WARNING: The number of DATA SETS defined in the schema is
GREATER
THAN the number of DATA SETS found on the DBLOAD media.
DATA SET 1: 1 entries.
End of volume 1, 0 read errors recovered.
DBLOAD operation completed.
END OF PROGRAM
:RUN QUERY.PUB.SYS
HP32216N.03.11 QUERY/NM THU, FEB 5, 1998, 7:12 AM
COPYRIGHT HEWLETT-PACKARD CO. 1976
>B=TEST
PASSWORD = >>
MODE = >>1
>FO SETS
DATA BASE: TEST THU, FEB 5, 1998, 7:12 AM
DATA BASE LANGUAGE ATTRIBUTE: NATIVE-3000
ITEM CURRENT ENTRY ENTRY BLOCKING
SETS: TYPE COUNT CAPACITY COUNT LENGTH FACTOR
NEW D 1 20 1 4 20
DET D 4 114 0 10 38
>LIST NEW
F4
12123412 note that this is data items F1, F2 AND part of F3
from dataset DET.
>E
END OF PROGRAM
:
As an alternative, the Dictionary/3000 programs DICTDBU and DICTDBL
are far better unload/load programs. They unload by name, and allow
set and field shuffling and editing.
Mike Berkowitz
Guess? Inc.
|