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: Michael Peppler <mpeppler at peppler dot org>
Subject: RE: Ctlib - ct_sql question
Date: Dec 22 2003 4:11PM

On Mon, 2003-12-22 at 01:56, Avis, Ed wrote:
> To split SQL at 'go' I use
> 
>     $dbh->do($_) foreach grep /\S/, split /^\s*go\s*$/m, $sql;
> 
> You'd need to do something a bit different if you wanted to return
> result sets from the SQL rather than just 'do'ing it.

I should point out that do() is a DBI/DBD::Sybase method (as the
original question was related to Sybase::CTlib).

And if the sql script being parsed is a valid script usable by isql then
the "go" has to be at the beginning of a line, so a split pattern of
/^go$/ should normally work.

Michael
-- 
Michael Peppler                              Data Migrations, Inc.
mpeppler@peppler.org                 http://www.mbay.net/~mpeppler
Sybase T-SQL/OpenClient/OpenServer/C/Perl developer available for short or 
long term contract positions - http://www.mbay.net/~mpeppler/resume.html