7 Einträge, 1 Seite |
1
2
3
4
5
6
7
8
my $id;
my $name;
my $user;
$query= "INSERT INTO TAbelle(ID,NAmen,User) VALUES('$id','$name','$user')";
$sth = $dbh->prepare($query) or die "Querry Error prepare: $DBI::errstr\n";
$ds = $sth->execute or die "Querry Error execute: $DBI::errstr\n";
$sth->finish;
Can't call method "prepare" on an undefined value at ./update.pl line 22.
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
#!/usr/bin/perl -w
#DatenbankAbfragen
use strict;
use warnings;
use DBI;
use Net::Telnet::Cisco;
use Digest::MD5;
my $session = Net::Telnet::Cisco-> new (Host => '10.200.2.100');
my $dbh;
my $raw_data;
my $sqldata;
my $filename;
my $id;
my $neid;
my $datacisco;
my $MD5;
my $query;
my $sth;
$query = "INSERT INTO Tabelle1(ID,NEID,BState,Data_Cisco,MD5) VALUES(?,?,now(),?,?,?)";
$sth = $dbh->prepare($query) or die "Error in query prepare: $DBI::errstr\n";
$sth->execute($id,$neid,'UP',$datacisco,$MD5) or die "Error executing query: $DBI::errstr\n";
$sth->finish();
$dbh = DBI->connect($data_source, $username, $auth, \%attr);
7 Einträge, 1 Seite |