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 peppler dot org>
Subject: RE: Using sybperl (was ANNOUNCE: sybperl 2.11)
Date: Sep 21 1999 10:17PM

Stern, Meir writes:
 > Hi to all,
 > 
 > I am very new to CTlib I am trying to insert a record to a table in a sybase
 > database what is the best way to do it. This is my code I have written
 > 
 > $isql= "insert into Ticket_Entry values
 > (\"$DATE\",\"$FORM{'requiredfirstname'}\
 > ",\"$FORM{'requiredlastname'}\",\"$FORM{'requiredphone'}\",\"$FORM{'building
 > '}\"
 > ,$FORM{'floor'},\"$FORM{'priority'}\",\"$FORM{'y2k'}\",\"$FORM{'requiredprob
 > lem_
 > desc'}\",\"$FORM{'platform'}\",\"$FORM{'os'}\",\"$FORM{'requiredGroupSubmit'
 > }\",
 > \"$FORM{'requiredstatus'}\",\"$FORM{'requiredtracker'}\",\"$FORM{'ticketype'
 > }\")
 > ";
 > $dbh = new Sybase::CTlib $user,$passwd,$SERVER,"undef" ;
 > print "got to here and this is $dbh \n";
 > $status = $dbh->ct_execute($sql);
 > while($dbh->ct_results($restype)==CS_SUCCEED)
 > {
 >         
 >         return $status;
 > }

If you had used the
	use strict;
pragma and the -w flag, you would have found your error immediately.

You assign your SQL string to the $isql variable, but then you pass
$sql to ct_execute().

Please take some time to read about the strict pragma, and maybe read
the two articles on useing sybperl that I've written, and that are
available from my web page.

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