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: "Stern, Meir" <Meir dot Stern at gs dot com>
Subject: RE: Using sybperl (was ANNOUNCE: sybperl 2.11)
Date: Sep 22 1999 1:14PM

Thanks so much for your response I will definitely look into that pragma.
However I did change the execute to $isql and received this error in return

Server message: Message number: 128, Severity 15, State 1, Line 1 Server
'NYREMEDY01' Message String: The name 'w' is illegal in this context. Only
constants,
constant expressions, or variables allowed here. Column names are illegal. 

Just  you should know I did try the insert with the column name and received
errors too I would like to use the column names as I will not be inserting
to every column every time. Thanks again in advance for your help



Meir Stern
Dept: User Support Engineering
Tel: 71727
Email: meir.stern@ny.email.gs.com



-----Original Message-----
From: Michael Peppler [mailto:mpeppler@peppler.org]
Sent: Tuesday, September 21, 1999 6:18 PM
To: SybPerl Discussion List
Subject: RE: Using sybperl (was ANNOUNCE: sybperl 2.11)


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