Problems w/MLDBM 
Author Message
 Problems w/MLDBM

I don't seem to be understanding the use of MLDBM. I have built a
multilevel hash table but I am unble to get it to write to a DBM file. I
receive "Can't use an undefined value as a HASH reference at "PROBLEM:"
when I use the code uncommented. It seems to work fine commented (uses
DBI to create the Hash). I have tried this with both DB_File(my prefered
method) and SDBM(the default DBM). What am I missing?

####### Begin Perl #########

#!/usr/local/bin/perl

#use MLDBM qw(DB_File);
#use MLDBM;
#use Data::Dumper;
use DBI;
#use Fcntl;

$drh=DBI->install_driver("Oracle");
$dbh=$drh->connect('t:polarbear:OR01P', 'laekupg', 'cold2day');
die unless $dbh;
#$dbm= tie%GEOBASE, MLDBM, 'geobase', O_CREAT|O_RDWR, 0640 or die $!;

$sql=<<eof;
select
well_name,strat_name,x_loc,y_loc,api,strat_occur_num,form_top_md,form_btm_md,form_top_ss,form_btm_ss
from geobase.v_formation_data_ckp
where well_name='1A-01'
eof

$csr=$dbh->prepare( $sql );






 }

Quote:
}

$csr->finish;
$dbh->disconnect;

for $well (keys %GEOBASE) {
 for $zone (keys %{$GEOBASE{$well}}) {
  for $attribute (keys %{$GEOBASE{$well}{$zone}}) {
   $value=$GEOBASE{$well}{$zone}{$attribute};
   #$status=$dbm->put($GEOBASE{$well}{$zone}{$attribute},$value);
   if (defined($value)) {
    printf "%-30s%-30s%-25s%20.2f\n",$well,$zone,$attribute,$value;
   }
  }
 }

Quote:
}

########### End Perl ##########


Tue, 05 Jan 1999 03:00:00 GMT  
 
 [ 1 post ] 

 Relevant Pages 

1. Q: Problem with MLDBM

2. Problems with MLDBM-modul, databasefile growing with duplicates

3. Problem with MLDBM Module

4. Problem installing MLDBM 2.00

5. Problem using MLDBM

6. Problem with MLDBM.pm

7. Problem using MLDBM

8. dbm problem (w/MLDBM)

9. problem compiling with MLDBM

10. MLDBM Problems

11. Problem with Storable and MLDBM

12. PROBLEM: data output w/MLDBM

 

 
Powered by phpBB® Forum Software