Michael Peppler
Sybase Consulting
Sybase on Linux
Install Guide for Sybase on Linux
General Sybase Resources
General Perl Resources
BCP Tool
Bug Tracker
Mailing List Archive
Downloads Directory
Sybase on Linux FAQ
Sybperl FAQ
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
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

-----Original Message-----
From: Michael Peppler []
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
 > 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'}\
 > '}\"
 > lem_
 > }\",
 > }\")
 > ";
 > $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 Peppler         -||-  Data Migrations Inc.    -||-
Int. Sybase User Group  -||-
Sybase on Linux mailing list: