| Front Page | News Headlines | Technical Headlines | Planning Features | Advanced Search |

April 2005

Get the most out of your Robelle Tools

What Detail Datasets
Have the Bad Data?

By Robelle Staff

You know there is an invalid key value in a TurboIMAGE automatic master, but you don’t know which of the 16 details contain the bad value. How to find them all?

You could create a custom Suprtool job that looks in each of the linked datasets. Nothing difficult, but time-consuming. Or, you could use the List;Related command of Suprtool’s Dbedit module.

This extremely simple command shows you all the entries in the database that are linked to one specific entry!

For example, I know that there is an invalid key value N45 0002 in the A-ACCOUNT-SITE automatic master. Remember, automatic entries are created, uh, automatically, when you insert data into a related detail. If you want to have the detail insertion to fail unless the key value has been previously inserted, you would use a manual master dataset.

:run suprtool.pub.robelle
>base cko               {open the database}
Password [;]?
>edit                           {enter the Dbedit module}
#                               {prompt changes to #}
#
#list a-account-site;related

List in File: A-ACCOUNT-SITE

ACCOUNT-SITE       >N45 0002   {Enter the bad value}

ACCOUNT-SITE    = N45 0002

Related Records from the File     :   D-SITE-INFO
Key to path: ACCOUNT-SITE
No records found for this path.

Related Records from the File     :   D-ADDRESS
Key to path: ACCOUNT-SITE
No records found for this path.

Related Records from the File     :   D-CPUS
Key to path: ACCOUNT-SITE
ACCOUNT-NO      = N45                   ACCOUNT-SITE    =  N45 0002
PRODUCT-CODE    = ST                    PRODUCT-OPTION  =  LIC
CPU-MODEL       = SERIES 997-800
TIER-PURCHASED  =                       CPU-OS          =  MPE/iX
CPU-NO  = 4                     CPU-HANDLE      =  BANDIT
CPU-ID-NO       = 818110156
SUPPORT-FLAG    = Y

ACCOUNT-NO      = N45           ACCOUNT-SITE    =  N45 0002
PRODUCT-CODE    = ST            PRODUCT-OPTION  =  LIC
CPU-MODEL       = SERIES 969-420
TIER-PURCHASED  =               CPU-OS          =  MPE/iX
CPU-NO          = 5             CPU-HANDLE      =   SMOKEY
CPU-ID-NO       = 301661304
SUPPORT-FLAG    = Y

ACCOUNT-NO      = N45           ACCOUNT-SITE    =  N45 0002
PRODUCT-CODE    = LQ            PRODUCT-OPTION  =  LIC
CPU-MODEL       = SERIES 969-420
TIER-PURCHASED  = 1             CPU-OS          =  MPE/iX
CPU-NO          = 0             CPU-HANDLE      =  SMOKEY
CPU-ID-NO       = 301661304
SUPPORT-FLAG    = Y
The List;Related command found three entries in the d-cpus dataset that contain the bad value, ACCOUNT-SITE = N45 0002.

We show our listing to the staff and they tell us that the proper ACCOUNT-SITE value is N45 0001. But what is the fastest way to fix it? We could use a serial Get, an Extract and an Update, but that is a lot of syntax to get correctly.

Or, we could use the Dbedit Change command, which changes the value of a master entry, and then updates all the detail entries that were pointed to by the original value. For example,

#change a-account-site
Change Key Value for File: A-ACCOUNT-SITE
Enter Existing Key Value to Find:
ACCOUNT-SITE       >N45  0002
Enter New Key Value to Replace with:
ACCOUNT-SITE       >N45  0001
ACCOUNT-SITE    = N45  0002
OK to change this entry [no]: y
Begin changes (be patient) .. .. end changes!!

That’s it. Less than 5 minutes to solve a problem that could have taken an hour to debug and fix. You can also do List;Related on a detail entry and Suprtool will show you all the master entries that point to it. Dbedit is also supported with the Eloquence database in Suprtool for HP-UX.


Copyright The 3000 NewsWire. All rights reserved.