
| Current Path : /home/ift/mails/ |
Linux ift1.ift-informatik.de 5.4.0-216-generic #236-Ubuntu SMP Fri Apr 11 19:53:21 UTC 2025 x86_64 |
| Current File : //home/ift/mails/sql1.pl |
#!/usr/bin/perl -w
# Copyright (c) 2013, Damian Lukowski
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
# * Redistributions of source code must retain the above copyright
# notice, this list of conditions and the following disclaimer.
# * Redistributions in binary form must reproduce the above copyright
# notice, this list of conditions and the following disclaimer in the
# documentation and/or other materials provided with the distribution.
# * Neither the name of the nor the
# names of its contributors may be used to endorse or promote products
# derived from this software without specific prior written permission.
#
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
# WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
# DISCLAIMED. IN NO EVENT SHALL BE LIABLE FOR ANY
# DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
# (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
# LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
# ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
# SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
use strict;
use DBI;
use DBD::mysql;
my $DEBUG = 0;
# Fill in the MySQL server properties
my ($dbhost,$dbport,$dbname,$dbuser,$dbpass) = ('localhost', 3306, 'zz1', 'xyz', 'jqwe');
my $rr = $ARGV[0];
print("110\n");
my $dbh = DBI->connect("dbi:mysql:$dbname:$dbhost:$dbport", $dbuser, $dbpass)
or die $DBI::errstr;
print("111\n");
my $qry = "SELECT instanceid,chunkid,val_binary FROM lob where instanceid >= " . $rr . " and instanceid < " . ($rr + 10000) . " and tag=26508 order by instanceid,chunkid";
print($qry);
#exit();
#my $ref = $dbh->selectall_arrayref($qry);
my $ref1 = $dbh->prepare($qry);
$ref1->execute();
print("123\n");
# exit;
my $text1 = "";
my $zaehler1 = 0;
while (my $row = $ref1->fetchrow_arrayref()) {
my $iid = sprintf("%06u",$row->[0]);
# print($iid);
# exit;
open my $fh, ">> zarafa.$iid";
print $fh $row->[2];
close $fh;
$zaehler1 = $zaehler1 + 1;
# print(" $zaehler1 " . $row->[0] . " " . $row->[1] . "\n");
}