Hello:
    I have not been able to successfully update my database using my code
listed below. The error I am getting with this version of the code is the
following:
DBD::Sybase::st execute failed: Server message number=170 severity=150
state=1 line=1 server='hostname' text=Line1: Incorrect syntax near ')' . at
dbi.pl line 27, <STDIN> line 4.
I am using DBD::Sybase-0.94 drivers with freetds-0.53 running on a Solaris 8
platform, and connecting to a Microsoft SQL 2000 database.
I have been successful connecting to the database, and performing some
rudimentary SELECTs.
What am I missing?


#!/opt/bin/perl -w
use DBI;

print "Enter the Book title\n";
chomp($Book_title = <STDIN>);

print "Enter the author of the book\n";
chomp($Author = <STDIN>);

print "Enter the Publisher of the book\n";
chomp($Publisher = <STDIN>);

print "Enter the ISBN for the book\n";
chomp($ISBN = <STDIN>);


# connect
$ENV{DSQUERY} = "hostname";
$dbh = DBI->connect("dbi:Sybase:database=databasename",'username',
'password', {RaiseError => 0});
die "Unable to connect to server $DBI::errstr"
    unless $dbh;
#Insert new data into table
$sth = $dbh->prepare("insert into Books(Book_title, Author, Publisher, ISBN)
values ('$Book_title', '$Author', '$Publisher', '$ISBN'))") || die "Couldn't
prepare statement: $DBI::errstr";

# execute query
$sth->execute() || die "Can't execute the SQL statement: $DBI::errstr";

# clean up
$dbh->disconnect();







-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to