Importing Data
Manufacturer
Use report “manufacturer.rpt”. Export to ‘manufacturer.chr’ and add the header.
This header is as follows:
TABLE Manufacturer
     desc, sym
And save it as ‘C:\Temp\manuf.txt
For importing run the following command:
Pdm_userload –f c:\temp\manuf.txt
Model
Run in the access file AHD the make table query “Make Man”.
Use report “model.rpt”. Export to ‘model.chr’ and add the header.
This header is as follows:
TABLE Manufacturer_Model
     mdl_mfr_id, mdl_sym
Because the database has a relations between several tables, some names of models need to be adapted for making it more clear. For example Deskjet DJ 1220C, Deskjet DJ1210 becomes Deskjet 1220C and Deskjet 1210.
Save it as ‘C:\Temp\model.txt’.
For importing run the following command:
Pdm_userload –f c:\temp\model.txt
Replace in USD the change values back to their original value
Contacts
Contacts are coming from a file called ‘VMTEL.TXT’. This file is updated every day. Therefore this script will run every day. This script will result in two files. One file (‘update.txt’) will update existing users. A second file will import new users into USD.
This script are adapted once moved over to server ‘Lofty’.
Used script file:
# Created by Wim Van der Planken (Synstar CS)
# Modified by Daniel Paessens (Synstar CoE CS)
# Version 0.1

#use strict;
use DBI;

my $insertfile = "insert.txt";
my $updatefile = "update.txt";

my $dbh = DBI->connect("dbi:Oracle:paradigm","paradigm","Passw0rd") || die("Can't connect to Oracle database: $DBI::errstr");

open(FILE,"VMTEL.TXT") || die("Can't open VMTEL.TXT: $!");
open(INFILE,">$insertfile") || die("Can't open $insertfile: $!");
open(UPFILE,">$updatefile") || die("Can't open $updatefile: $!");
print UPFILE "TABLE Contact\n\tid c_public_phone c_userid c_contact_num  c_dept c_expense c_last_name c_first_name c_e-mail_addr\n";
print INFILE "TABLE Contact\n\tc_public_phone c_userid c_contact_num  c_dept c_expense c_last_name c_first_name c_ctp_id c_e-mail_addr\n";
foreach(readline(FILE))
       {
       chomp;
       my $first   = substr($_,0,4);$first   =~ s/\s+$//;
       my $second  = substr($_,5,8);$second  =~ s/\s+$//;
       my $third   = substr($_,14,4);$third  =~ s/\s+$//;
       my $fourth  = substr($_,19,3);$fourth =~ s/\s+$//;
       my $fifth   = substr($_,23,4);$fifth  =~ s/\s+$//;
       my $sixth   = substr($_,28,20);$sixth =~ s/\s+$//;
       my $seventh = substr($_,48);
       if($seventh =~ /^\)/)
             {
             $sixth .= ')';
             $seventh = substr($seventh,1);
             }
       my $sth = $dbh->prepare("select id from paradigm.ctct where c_userid = '$second'") ||die("Can't prepare SQL statement: $DBI::errstr");
       $sth->execute || die("Can't execute SQL statement: $DBI::errstr");
       my $id = $sth->fetchrow_array();
       if($id)
             {
             print UPFILE "\t{ \"$id\", \"$first\", \"$second\", \"$third\", \"$fourth\", \"$fifth\", \"$sixth\", \"$seventh\", \"$second\@bei.org\" }\n";
             }
       else
             {
             print INFILE "\t{ \"$first\", \"$second\", \"$third\", \"$fourth\", \"$fifth\", \"$sixth\", \"$seventh\", \"2305\", \"$second\@bei.org\" }\n";
             }
       }
close(FILE);
close(INFILE);
close(UPFILE);
$dbh->disconnect() || die("Error disconnecting: $DBI::errstr");

For importing the follow command lines are used:
Pdm_userload –f c:\temp\update.txt (ÞHas been removed on request)
Pdm_load –I –f c:\temp\insert.txt