Biblioteka/bin/test_sql.pl

22 lines
557 B
Perl
Executable File

#!/usr/bin/perl
use DBI;
my $dbfile = 'a.db';
my $dbh = DBI->connect("dbi:SQLite:dbname=$dbfile", "", "");
#$dbh->do("create table abc (int a)");
#$dbh->do("insert into abc values (7)");
#print $dbh->do("select * from abc");
#my $sth = $dbh->prepare("select * from abc"); # prepare the query
#$sth->execute(); # execute the query
#my @row;
#while (@row = $sth->fetchrow_array) { # retrieve one row
# print join("\n", @row), "\n";
#}
my $sth = $dbh->prepare ("update qwe set liczba=20 where id=2");
$sth->execute();