HP3000-L Archives

May 2002, Week 3

HP3000-L@RAVEN.UTC.EDU

Options: Use Monospaced Font
Show Text Part by Default
Show All Mail Headers

Message: [<< First] [< Prev] [Next >] [Last >>]
Topic: [<< First] [< Prev] [Next >] [Last >>]
Author: [<< First] [< Prev] [Next >] [Last >>]

Print Reply
Subject:
From:
Ken Hirsch <[log in to unmask]>
Reply To:
Ken Hirsch <[log in to unmask]>
Date:
Thu, 16 May 2002 11:21:46 -0400
Content-Type:
text/plain
Parts/Attachments:
text/plain (51 lines)
Brian Duncombe wrote:
> Not being a Perlite, it sounds like maybe when you don't specify a list,
> you get all fields that you are allowed based upon TurboImage security.
> When you specify a list, maybe you are asking for something that you are
> not allowed to access?

This is a possiblity, although I don't think DBINFO would list them if he didn't
have access.  I'm not sure about that, though.

Anyway, I've never had to use a list with MPE::IMAGE, but I tried it out today and
it worked fine.  I tried both a string and a list reference (below) and had no
problem.

Here's an example that uses the example database from the Image manual (with the
passwords changed).  It shows how to use the schema argument.  If your data item is
six bytes, it probably should be a P12.  Do you have the declaration of it in some
other language, like COBOL?

#!perl -w

use MPE::IMAGE ':all';

my $db = DbOpen('ORDERS.DATA','READ',5);
die "DbOpen Error: $DbError" if $DbError;

my @invschema = (
  'BINNUM'    => 'Z2',
  'SUPPLIER'  => 'X16',
  'STOCK#'    => 'U8',
  'UNIT-COST' => 'P8',
);

my @invlist;
for (my $i=0; $i <= $#invschema; $i += 2) {
  push @invlist, $invschema[$i];
}


my %data;
while ($DbStatus[0] == 0) {
    %data = DbGet($db,2,'INVENTORY', \@invlist, undef, \@invschema);
    if ($DbStatus[0] == 0) {
      for (keys %data) {
        print "$_ => $data{$_}\n";
      }
    }
}

* To join/leave the list, search archives, change list settings, *
* etc., please visit http://raven.utc.edu/archives/hp3000-l.html *

ATOM RSS1 RSS2