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: Michael Peppler <mpeppler at MBAY dot NET>
Subject: Re: Executing sql statements stored in a file
Date: Sep 16 1997 4:51PM

Rakesh Dinger wrote:
> Hi,
> I have a requirement where I need to execute a bunch of sql statements (which
> are stored in a file) from within a perl script.
> I tried using system and isql, but this does not work as perl was compiled with
> the suidperl security patch: (The script has setuid on by design.)
>  .....system ("isql -Usa -S$SVR -P$PWD -i $PROCFILE");
> /home/rdinger>
> ==>  Insecure dependency in system while running setuid at /dev/fd/3 line 281,
>       chunk 13.

You should be able to fix that by using an absolute path to isql (ie
something like 

system ("/usr/local/sybase/bin/isql -Usa -S$SVR -P$PWD -i $PROCFILE");

> I then tried to read in the file line-by-line and build up a dbcmd string, but
> then I have to backslash all the sybase @ variables within the st proc file (
>  which is a pain).

You only have to escape the @ variables if you use double quotes.
Use single quotes (or the q() function) and you should be OK.

Michael Peppler       -||-  Data Migrations Inc.  -||-