File: joetest2.pl

package info (click to toggle)
libdbd-odbc-perl 1.24-1
  • links: PTS, VCS
  • area: main
  • in suites: squeeze
  • size: 1,012 kB
  • ctags: 398
  • sloc: perl: 6,314; ansic: 4,875; makefile: 29; sql: 8
file content (32 lines) | stat: -rwxr-xr-x 814 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
#!perl -w
# $Id: joetest2.pl 11680 2008-08-28 08:23:27Z mjevans $

use strict;
use Getopt::Std;
use DBI qw(:sql_types);

# Connect to the database and create the table:
my $dbh=DBI->connect() or die "Can't connect";
$dbh->{RaiseError} = 1;
$dbh->{AutoCommit} = 0;
$dbh->{LongReadLen} = 800;
if (-e "dbitrace.log") {
   unlink("dbitrace.log");
}
$dbh->trace(9,"dbitrace.log");
my $sth = $dbh->prepare("EXEC setLock ?,?,?,?,?");


$sth->bind_param (1, "JOET_log2_20020712170736", SQL_VARCHAR);
$sth->bind_param (2, "LOCKED",    SQL_VARCHAR);
$sth->bind_param (3, "JOET",    SQL_VARCHAR);
$sth->bind_param (4, 0, SQL_INTEGER);
$sth->bind_param (5, "2002-07-12 17:07:36", SQL_TYPE_TIMESTAMP);
$sth->execute;
my @data;
my $success;
while (my @data = $sth->fetchrow_array()) {
   ($success) = @data;
}

$dbh->disconnect;