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: Robert_Gorrebeeck at concentra dot com
Subject: Question about placeholders/variables in insert statements
Date: Jan 4 2008 9:25PM

All

I have a question regarding Insert statements using placeholders.

Is it possible to replace the placeholders with variables? 
I have tried and it gives me the following error :
        DBD::Sybase::st execute failed: Server message number=128 
severity=15 state=1 line=1 text=The name 'U' is illegal in this context. 
Only constants, constant expressions, or        variables allowed here. 
Column names are illegal.


So for example from this:

$sth=$dbh-prepare("INSERT INTO table (column1, column2) VALUES (?,?)");
$sth->execute($value1, $value2);

to this:

$sth=$sbh->prepare("INSERT INTO table (column1, column2) VALUES ($value1, 
$value2)");
$sth->execute;

Just curious is this is possible

Thanks

Robert Gorrebeeck
EAI Developer
Concentra
5080 Spectrum Drive, Suite 1200W
Addison, TX 75001
972.725.6956
Robert_Gorrebeeck@concentra.com
****** CONFIDENTIALITY NOTICE ******
NOTICE: This e-mail message and all attachments transmitted with it may contain legally privileged and confidential information intended solely for the use of the addressee. If the reader of this message is not the intended recipient, you are hereby notified that any reading, dissemination, distribution, copying, or other use of this message or its attachments is strictly prohibited. If you have received this message in error, please notify the sender immediately and delete this message from your system. Thank you.