Beefy Boxes and Bandwidth Generously Provided by pair Networks
"be consistent"
 
PerlMonks  

Re^2: dbd odbc sql big file blues

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


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

This works fine for me with the Easysoft SQL Server ODBC Driver:

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; } $Data::Dumper::Indent = 0; my $r = $h->selectall_arrayref(q/select len(a) from mje/); print Dumper($r);

outputs:

'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 Inserted 1000 Inserted 2000 Inserted 4000 Inserted 8000 Inserted 16000 Inserted 32000 Inserted 64000 Inserted 128000 Inserted 256000 Inserted 512000 Inserted 1024000 Inserted 2048000 Inserted 4096000 Inserted 8192000 Inserted 16384000 $VAR1 = [['1000'],['2000'],['4000'],['16000'],['32000'],['64000'],['12 +8000'],['256000'],['512000'],['1024000'],['2048000'],['4096000'],['81 +92000'],['16384000'],['8000']];


Comment on Re^2: dbd odbc sql big file blues
Select or Download Code
Re^3: dbd odbc sql big file blues
by CaptainDaddy (Initiate) on Mar 20, 2013 at 18:37 UTC
    I have managed to make the demo script that I wrote before work by switching to DBD:Sybase. I'll post the code and the output soon( I will attach it above, so it may be there if your reading this... hee hee) Thanks for helping me determine that it was (probably) not the scripting.
      There's a similar bug report link to bug report involving size of inserton CPAN, with a fix that I don't understand. Sybase isn't working out becuase it scrambles my files (see dbd:Sybase bit scramble).
      I'll update soon after trying a new driver.
      Thanks again for the help, I've found it useful.

        So in order to avoid spending money on a driver (although I did try the easysoft driver and it worked well), I wrote a c# script to update the column of my table which held the actual binary data from the files which I wanted to insert. So, although I now have to ftp the files to a windows box and then insert and delete them there, it works. There is a great example on how to do the c# udate on the web elsewhere.

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others about the Monastery: (10)
As of 2014-07-13 13:45 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    When choosing user names for websites, I prefer to use:








    Results (249 votes), past polls