Beefy Boxes and Bandwidth Generously Provided by pair Networks
Do you know where your variables are?

Re^2: dbd odbc sql big file blues

by mje (Curate)
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);


'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']];

Replies are listed 'Best First'.
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?

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://1024241]
NodeReaper eats a grue

How do I use this? | Other CB clients
Other Users?
Others exploiting the Monastery: (1)
As of 2018-02-23 00:51 GMT
Find Nodes?
    Voting Booth?
    When it is dark outside I am happiest to see ...

    Results (300 votes). Check out past polls.