Updating with DataMajor

You can use DataMajor to update Premvet.

You may have used the Tidy-Up options and noticed miss-spellings on some breeds, you may have both Rabbits and Lagomorphs listed as species. This option allows you to make changes back into Premvet to correct the data. Any changes made this way will:

What Can I Update?

How?

There are some sample scripts in Stored Reports on the 'Update' Sub-Menu, if those do not handle it then just write your own using one of the examples. As this does Update both Premvet and DataMajor it is protected via an Access Permission - Only staff with access to '130' will be allowed into this sub-menu.

Once the script has run, you will get the question.


Do you still want to update the records? Yes No

It is only AFTER you answer Yes to this question will any records be updated.

The script is created as per any of the standard scripts on the system, as you are only dealing with the Animal Table they are usually a lot simpler.

To enable the update option you need to:

Lets look at one of the sample scripts, this will look for any rodents in the breed field and update the Species to 'Rodent'.
The important lines are in Bold.


## Scan all the Breeds for any Rodents and update Species
##
## WARNING THIS OPTION WILL UPDATE THE DATABASE
# SET UPDATE SPECIES

SELECT  
  pvid as "Record",
  species as "Existing", breed as "Breed",
  "Rodent" as "Change To"
FROM animal
WHERE breed in ("Rat","Ferret","Hamster","Mouse","Gerbil","Guinea Pig")
AND species not in ("Canine","Feline","Rodent") ;

The important bits are:

If these basics are followed it will work.

There are a couple of things to keep in mind.

The current supplied reports are:

uproad
Look for exact matches of "Rat", "Ferret", "Hamster", "Mouse", "Gerbil" or "Guinea Pig" in the breed field and if the Species in NOT one of "Canine", "Feline" or "Rodent" then change the Species to Rodent.

upspec
You will be asked the Species you want the field set to if the Breed CONTAINS something e.g. Look for 'Rabbit' in the Breed and set the Species to 'Lagomorph'.

upspec1
Change Species, look for records currently containing one thing and change to to something else. e.g. Rabbit to Lagomorph

upbreed
Change the breed, e.g. miss-spellings, you will be asked the Breed to set the record to, the existing breed (contains) and an optional question regarding the Species e.g. all GSD to German Shepherd Dog

Power Users

The upsec, upspec1 and upbreed scripts will use Regular Expressions for the match as will any future scripts if the contain 'Regex' on the information screen - all this means is some characters have a special meaning. These are:

^ The beginning of the string
$ The end of the string
. Any character
[...] Any character between the []'s
x|y|z Either x or y or z

Examples

^Pig This will match text starting with pig e.g. not Guinea Pig
^Pig$ This will match exactly pig
dsh$ This will entries ending with dsh, will not match with Staffordshire.
Budgie|Goose This will match if it contains either Budgie or Goose

You will have problems when you try to match some punctuation characters e.g. ?, there are ways around this, that is use [[:punct:]] but as you can see it is a little cryptic. We will not be documenting any of the advanced Regular Expressions here, if you need help contact support. [Back to Data Major Manual]