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 Peppler Data Migrations, Inc.
Sybase T-SQL/OpenClient/OpenServer/C/Perl developer available for short or
long term contract positions - http://www.mbay.net/~mpeppler/resume.html