PEPPLER.ORG
Michael Peppler
Sybase Consulting
Menu
Home
Sybase on Linux
Install Guide for Sybase on Linux
General Sybase Resources
General Perl Resources
Freeware
Sybperl
Sybase::Simple
DBD::Sybase
BCP Tool
Bug Tracker
Mailing List Archive
Downloads Directory
FAQs
Sybase on Linux FAQ
Sybperl FAQ
Personal
Michael Peppler's resume

sybperl-l Archive

Up    Prev    Next    

From: Christopher Luk <wluk at ied dot edu dot hk>
Subject: dbwritetext error message
Date: Jul 12 1999 7:18AM

hi,
i have the following error message received while trying to update an
column on an text/image field. the syntax is copying from the syperl perl
manual. i can use "insert into...." to insert char, int into a table, but
it seems not work for text/image, so that i dig into the manual and found
something like the following script. however, i spend half day tring
differe parameter but still can't make it work. please advise.

>>>>>>>>>>>>>>>>>>>>Waiting_List.introduction Sybase::DBlib=HASH(0x29e63c)
12 11
Msg 156, Level 15, State 1
Line 1
        Incorrect syntax near the keyword 'NULL'.
DB-Library error:
        General SQL Server error: Check messages from the SQL Server.
>>>>>>>>>>>>>>>>>>>>Waiting_List.introduction

sub sql_text(){
  my( $cmd, $field, $content, $user, $passwd, $server, $database) = @_;
  my( $dbh, $dbh_2, @data, $size);
  $dbh = new Sybase::DBlib $user, $passwd, $server, $database, {Global =>
{}, Cols => {}};
  $dbh_2 = new Sybase::DBlib $user, $passwd, $server, $database;
  $dbh_2->dbcmd( "$cmd\n");
  $dbh_2->dbsqlexec;
  $dbh_2->dbresults;
  @data = $dbh_2->dbnextrow;
  print ">>>>>>>>>>>>>>>>>>>>$field "  . $dbh . " " . $dbh->dbspid . " " .
$dbh_2->dbspid . "\n";
  $dbh->dbwritetext( $field, $dbh_2, 1, $content, TRUE);
  print ">>>>>>>>>>>>>>>>>>>>$field\n";
  $dbh_2->dbclose;
  $dbh->dbclose;
  return $0;
}; #sql_text

--
Regards, Christopher Luk Wan
Research Assistance I (System Administration), IT in Education Network
The Hong Kong Institute of Education
Office : (852)29486608 Fax : (852)29487936 Email : wluk@ied.edu.hk