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: Michael Peppler <mpeppler at MBAY dot NET>
Subject: Re: Problem running program written under CTlib
Date: Sep 30 1997 6:10PM

Kyle Partridge wrote:
> 
> Michael Peppler wrote:
> 
> > You must be calling ct_results once too many.
> >
> > What does your code look like?
> >
> 
> Here is the test program I have been trying to debug:
> 
> #!/usr/local/bin/perl -w
> 
> use lib "/usr/local/sybase/lib";
> use lib "/usr/local/sybase/devlib";
> use lib "/usr/local/sybase/include";

Unless you have *perl* code in those directories the above use lib
directives are unnecessary.

> use lib "/home/sybase/sybperl-2.07/CTlib";
> use lib "/tech/bgeplib";
> 
> use strict;
> 
> use Sybase::CTlib;
> 
> my $handle = Sybase::CTlib->ct_connect('user', 'password', 'SQL1');
> 
> my $sql_statement = "insert into utility..inventory
> values (14, 'Latest and Greatest Thing', 3, 14.95)";
> 
> my $ret_proc = "text";
> my $rval = undef;
> my $results_type = undef;
> my $ret_val = undef;
> my $type = "insert";
> if (!($sql_statement =~ /^[Ii]nsert/))
>     {
>           print "This is not an insert statement.\n";
>      }
> 
> $ret_val = $handle->ct_sql("$sql_statement");

ct_sql() already calls ct_results. You may have used webSQL before,
and webSQL's ct_sql() is really Sybperl's ct_execute(). They
changed the name at some point (it was initially ct_execute()
when we were defining the API together)...

Michael
-- 
Michael Peppler       -||-  Data Migrations Inc.
mpeppler@datamig.com  -||-  http://www.mbay.net/~mpeppler