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: "Klein, Shoshana R" <Shoshana dot Klein at gs dot com>
Subject: using sybperl, how to insert data that contains a quote with in it
Date: Jan 5 2001 3:44PM

Below is my sql statement to insert data into a table.
the variable $in_name  contains on occasion a single quote  for example john
o'brien.

I get back an sql error for the single quote
I've tried the following variations
anyone know how I can keep the value of the variable when it includes a
single quote




 my  $sql ="insert into amp_repos_user_app  values
                   ('$guid', '$in_aid',
                 '$in_name', '$in_login', '$in_second_login',
                  '$in_dept', '$in_user_dept_load_dt', '$upd_dtm')";




 my  $sql ="insert into amp_repos_user_app  values
                   ('$guid', '$in_aid',
                "$in_name", '$in_login', '$in_second_login',
                  '$in_dept', '$in_user_dept_load_dt', '$upd_dtm')";



my  $sql ="insert into amp_repos_user_app  values
                   ('$guid', '$in_aid',
                '"$in_name"', '$in_login', '$in_second_login',
                  '$in_dept', '$in_user_dept_load_dt', '$upd_dtm')";





    sql_query($login, $sql);