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 Peppler -||- Data Migrations Inc.
firstname.lastname@example.org -||- http://www.mbay.net/~mpeppler