my ($conn); my($sample_name, $blob_file); &GetOptions("n=s" =>\$sample_name, "f=s" =>\$blob_file, ); my $db_type = 'test'; # or live my $team = 78; { #conn_setup(); update(); } sub update { my $conn; open(BLOB, $blob_file) ||die "Cannot open the blob file\n"; my $bytes = 0; my $buf; $bytes = read(BLOB, $buf, 500000); print STDERR "Read $bytes bytes\n"; close(BLOB); eval { $conn = Database::Conn->new('live');#module to connect to DB $conn->addConnection(DBI->connect('dbi:Oracle:CANT.world', 'nst_owner', 'NST_OWNER', {RaiseError => 1, AutoCommit => 0}),'nst'); my $sample_id = $conn->execute('nst::Copynumber::GetCosmicSampleId', $sample_name); #print $sample_id; $conn->execute('nst::Copynumber::InsertContourPlots',$buf, $sample_id); };if($@){ warn "ERROR: ".$@; $conn->rollback; exit; } else { $conn->commit; } }