Hi all,
Bear with me as I'm very new to PERL (Literally only a day of experience).
I'm trying to read a PDF file from an IMAGE datatype column in Sybase and then save the file to disk on the server.
I've looked at the Sybase documentation on syb_ct_data_info and syb_ct_get_data but I don't seem to be getting anywhere as I'm finding it to be a very confusing process.
This is what I have so far -
my $sth = $dbp->prepare("SELECT pdf_report FROM report_table WHERE rep
+ort_name = ($report_name_here)");
$sth->{syb_binary_images} = 1;
$sth->{syb_no_bind_blob} = 1;
$sth->execute();
while (my @row = $sth->fetchrow_array) {
my $image = $sth->syb_ct_get_data(1, \$pdf_report, 0);
#This just prints out the size of the file, how can I actually retr
+ieve the file and write it to disk?
print "$image\n";
}
Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
Read Where should I post X? if you're not absolutely sure you're posting in the right place.
Please read these before you post! —
Posts may use any of the Perl Monks Approved HTML tags:
- a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
| |
For: |
|
Use: |
| & | | & |
| < | | < |
| > | | > |
| [ | | [ |
| ] | | ] |
Link using PerlMonks shortcuts! What shortcuts can I use for linking?
See Writeup Formatting Tips and other pages linked from there for more info.