Beefy Boxes and Bandwidth Generously Provided by pair Networks
Welcome to the Monastery
 
PerlMonks  

Re^4: dbd odbc sql big file blues

by mje (Deacon)
on Mar 19, 2013 at 16:55 UTC ( #1024342=note: print w/ replies, xml ) Need Help??


in reply to Re^3: dbd odbc sql big file blues
in thread dbd odbc sql big file blues

I suggest it is a problem with your ODBC Driver as when I run my example above with your inserts and the Easysoft ODBC Driver I get:

use strict; use warnings; use DBI; use Data::Dumper; my $h = DBI->connect(); eval { $h->do(q/drop table mje/); }; $h->do(q/create table mje (a varbinary(max))/); my $t = $h->column_info(undef, undef, 'mje', 'a'); DBI::dump_results($t); my $x = 'a' x 1000; my $s = $h->prepare(q/insert into mje values(?)/); #foreach (1..15) { # $s->execute($x); # print "Inserted ", length($x), "\n"; # $x = $x x 2; #} $s = $h->prepare("insert into mje values (?)"); # 350kBites -> largest number is 2^(8*350000)-1 for(my $i = 75; $i<2**28000000;$i=$i*2){ print"did"; my $insert='g'x$i; $s->bind_param(1,$insert,DBI::SQL_VARBINARY); $s->execute() or print" not "; $s->finish(); my $sz=length($insert); print " succeed. size: $sz\n"; } $Data::Dumper::Indent = 0; my $r = $h->selectall_arrayref(q/select len(a) from mje/); print Dumper($r);

I stopped it at 314572800 bytes as I was running out of memory. The output was:

'master', 'dbo', 'mje', 'a', '-3', 'varbinary', 0, 0, undef, undef, '1 +', undef, undef, '-3', undef, 0, 1, 'YES', '0', '0', '0', '0', undef, + undef, undef, undef, undef, undef, '37' 1 rows did succeed. size: 75 did succeed. size: 150 did succeed. size: 300 did succeed. size: 600 did succeed. size: 1200 did succeed. size: 2400 did succeed. size: 4800 did succeed. size: 9600 did succeed. size: 19200 did succeed. size: 38400 did succeed. size: 76800 did succeed. size: 153600 did succeed. size: 307200 did succeed. size: 614400 did succeed. size: 1228800 did succeed. size: 2457600 did succeed. size: 4915200 did succeed. size: 9830400 did succeed. size: 19660800 did succeed. size: 39321600 did succeed. size: 78643200 did succeed. size: 157286400 did succeed. size: 314572800


Comment on Re^4: dbd odbc sql big file blues
Select or Download Code
Re^5: dbd odbc sql big file blues
by CaptainDaddy (Initiate) on Mar 20, 2013 at 14:42 UTC

    Thanks a bunch for helping me with this; So I'm using unixODBC, FreeTDS, and DBD::ODBC. As I understand it FreeTDS is the ODBC Driver, correct? Also are there any other differences between the packages we are using?

Re^5: dbd odbc sql big file blues
by Anonymous Monk on Mar 20, 2013 at 15:34 UTC

    Thanks a bunch for helping me with this; So I'm using unixODBC, FreeTDS, and DBD::ODBC. As I understand it FreeTDS is the ODBC Driver, correct? Also are there any other differences between the packages we are using?

      sorry this was an accidental repeat.

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://1024342]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others imbibing at the Monastery: (11)
As of 2014-09-01 19:16 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    My favorite cookbook is:










    Results (16 votes), past polls