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: Jie Gao <J dot Gao at isu dot usyd dot edu dot au>
Subject: Re: getting return messages
Date: Aug 5 1999 5:38AM

On Wed, 4 Aug 1999, Jie Gao wrote:

> Hi All,
> 
> I get the following message after doing an insert:
> 
> [Wed Aug  4 17:35:32 1999] null: Sybase::CTlib=HASH(0x1a1cbc)->ct_execute('INSERT INTO afm.wr (entered_by, dv_id,
> dp_id, bl_id, rm_id, prob_type, description, requestor, phone, date_requested, time_requested) VALUES ('JIEGAO',
> 'P', 'P05', '000', '', 'AUDIO-VISUAL', '', 'JIE GAO', '88888888888888', getdate(), getdate())') == 1 at
> /opt/www/data/perl-bin/fmo_work.cgi line 322.
> 
> 
> Server message: (In srv_cb)
> Message number: -307, Severity 0, State 0, Line 0
> Server 'pc-155'
> Message String: all threads are blocked
> wr insert: restype = "4048"
> wr insert: restype = "4046"
> 
> 
> There is a successful select before the insertion: 
> 
> $dbh->ct_execute("SELECT em_id FROM afm.em where em_id = 'JIE GAO'");
> 
> while(($rc = $dbh->ct_results($restype)) == CS_SUCCEED) {
>     print STDERR "1st select restype = \"$restype\"\n" if $debug;
>     next if (!$dbh->ct_fetchable($restype));
>     while (@row = $dbh->ct_fetch(0,0)) {
>         ($selected) = @row;
>         $selected =~ s/\s*$//g;
>         print STDERR "selected em_id = \"$selected\"\n" if defined $selected;
>     }
> }
> 
> 
> What have I done wrong?

I have solved the problem by myself: Adding quotes to the sql statement

    $dbh->ct_execute("$statement");

seems to work.


Jie