Thread Oracle-DB: Auslesen von BLOBs und speichern (16 answers)
Opened by provisoft at 2012-04-04 16:25

Gast provisoft
 2012-04-05 11:07
#157264 #157264
Code (perl): (dl )
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
$sqlStmtSel = "SELECT DATA 
                     FROM BINARY_DATA
                     where ID = 97312";
            
$dbhsrc->{LongReadLen}=150000000;  # Make sure buffer is big enough for BLOB
$stmtSel = $dbhsrc->prepare($sqlStmtSel) || die "\nPrepare error:$DBI::errstr\n";

# Daten des BLOB lesen
my @data = $stmtSel->fetchrow_array;
my $BLOB = shift @data;
     
     
# Handle für die Ausgabe diverser CGI-"Sachen"
my $cgi = CGI->new;
     
# Bild ausgeben
$|=1;
print $cgi->header(-type=>"image/jpeg",-charset=>"");
binmode(STDOUT);
#print STDOUT $BLOB;
     
print "<p align='left'><img src=$BLOB></p>";


modedit Editiert von GwenDragon: Code in CODE-Tags gestellt
Last edited: 2012-04-05 12:28:48 +0200 (CEST)

View full thread Oracle-DB: Auslesen von BLOBs und speichern