I run the same query from SQL Database Management Studio, and I can get the binary data out as 0x524946469C3F0300.......
So I think the query and data are good. It must be this conversion error.
The first fecth will give me multi-line outputs of TESTING.
When I use length($field), got 0s all over of screen.
But the second one (fetchrow_array)I got error message of
error_handler: Data-conversion resulted in overflow.
and nothing was displayed besides that.
ALso, when I use your...
There is no duplication in database. Since I got 1 as output from the database when I run below code.
CODE
$query = "select count(*) from English_English where Audio_Name = 'ENG_2.WAV'";
$sth = $dbh->prepare($query) or die "prepare failed\n";
$sth->execute() or die "unable to execute query...
Thank you, BrianAtWork.
I did output something from the loop. And I notice if I use while(my ($field) = $sth->fetch) {
print "TESTING\n";
print OUTF $field;
}
I can see forever loop of printing TESTING. But when I use
while(my ($field) = $sth->fetchrow_array) {
print "TESTING\n"...
Thank you, Kirsle.
1. Yes, I do get an empty wav file.
2. I am not sure what happened in the database. But I know it was a good valid wav audio file before it got into database.
3. When I output the count(*) from the same query, it is ONE. So I believe it only got one wav file back.
Thank you...
Hi, there,
I am using Perl:DBI to talk with SQL server. I want to get the varbinary data from database and saved as .wav file. I couldn't find useful information about handling binary data in Perl. And my code doesn't work.
Can somebody help me out?
Thank in advance!
Below is my code...
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.