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: Re: how can i update text/image thru. sybase
Date: Jul 15 1999 4:04AM

hi,
i have posted this message once, i have made various modification, however, its
doesn't work out at all.

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


Michael Peppler wrote:

> Christopher Luk writes:
>  > as subject, i can't make it success using the method suggested in the sybperl
>  > manual.
>  >
>
> If you showed us the code you try to use it might be easier to tell
> you what you're doing wrong...
>
> Michael
> --
> Michael Peppler         -||-  Data Migrations Inc.
> mpeppler@peppler.org    -||-  http://www.mbay.net/~mpeppler
> Int. Sybase User Group  -||-  http://www.isug.com
> Sybase on Linux mailing list: ase-linux-list@isug.com

--
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