
| Current Path : /var/www/web-klick.de/dsh/ |
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 : /var/www/web-klick.de/dsh/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, 'zarafa', 'xyz', 'widor123');
print("110\n");
my $dbh = DBI->connect("dbi:mysql:$dbname:$dbhost:$dbport", $dbuser, $dbpass)
or die $DBI::errstr;
print("111\n");
my $qry = "SELECT val_binary FROM lob limit 1000";
#my $ref = $dbh->selectall_arrayref($qry);
my $ref1 = $dbh->prepare($qry);
$ref1->execute();
print("123\n");
# exit;
my $text1 = "";
my $zaehler = 0;
my $zaehler1 = 0;
while (0 == 0) {
my $row = $ref1->fetchrow_arrayref();
#
#
#for my $row (@$ref) {
if ($zaehler1 > 100) {
$zaehler1 = 0;
open my $fh, "> mails3.$zaehler";
print " Writing $zaehler";
print $fh $row->[0];
close $fh;
$text1 = "";
$zaehler = $zaehler + 1;
}
$text1 = $text1 . $row->[0] . "\n";
$zaehler1 = $zaehler1 + 1;
print(" $zaehler1\n");
if ($zaehler > 2) {
exit;
}
}