Perl DBI : quote function v/s bind_params , handling large inputs -


want understand difference between dbi::quote v/s bind_params of statement handlers, while handling large inputs stored procedure.

environment : perl + dbi + freedtds -> sql server

sample code 1 : using function quote()

$xml = `cat bigfile_insrt.txt.xml.5k`;  $qouted = $dbh->quote($xml); $dbh->do(qq{exec sp_toload \@xml = $qouted});  code seems can handle till 100mb worth of $xml 

sample code 2 : using bind_params clob

my $qry = "exec sp_toload \@xml = ?"; $xml = `cat bigfile_insrt.txt.xml.5k`; $sth = $dbh->prepare($qry); #$sth->bind_param(1,$xml,sql_longvarbinary); $sth->bind_param(1,$xml,sql_clob); $sth->execute();  gets truncated 7k bytes max $xml 

wondering why bind_params both sql_longvarbinary or sql_clob cannot go beyond 7k bytes, while sample 1 using quote can handle ~100mb of data


Comments

Popular posts from this blog

java - Jasper subreport showing only one entry from the JSON data source when embedded in the Title band -

mapreduce - Resource manager does not transit to active state from standby -

serialization - Convert Any type in scala to Array[Byte] and back -