my $sqlquery = "SELECT Date_, Graphic_Image from GRAPHIC_VIEW ..."; $dbHandle->{syb_binary_images} = 1; #return image as binary not hex my $sth = $dbHandle->prepare($sqlquery); $sth->{syb_no_bind_blob} = 1; $sth->execute; my $row; my $len; while(1){ # segementation fault in next statement $len = $sth->func(2,$imgchunk,2048,'ct_get_data'); last if $len != 2048; }