Up Prev Next
From: Brad Morrison <brad at neosoft dot com>
Subject: Re: Transactions
Date: Aug 27 1999 2:05AM
At 04:00 PM 8/25/1999 +0000, you asked a question way over my head; I just
hack at Sybase with Sybperl on a program I inherited, plus some supporting
stuff I invented. Anyway:
I can *almost* read your code example, but--would you mind helping me to
understand it? If not, I understand, but I also know that the dumb
questions are the ones you don't ask.
I still don't understand the difference between use'ing strict and using
the -w flag to Perl, but this is a low-priority question, I feel. See below.
>my($srv) = 'SERVER';
>my($dbn) = 'DATABASE';
>my($uid) = 'USER';
>my($pwd) = 'PASSWORD';
>my $dbh = Syb->new($srv, $uid, $pwd, $dbn)
> || die "\nFailed to create a database handle for '$srv.$dbn'.\nStopped";
So far, so good...
> ($sql = <<"SQL") =~ s/^\s+@@@ ?//gm;
> @@@ -- begin transaction
> @@@ select * from master..syslogins
> @@@ if \@\@error != 0
> @@@ begin
> @@@ raiserror 30000, 'OUCH'
> @@@ end
> @@@ -- commit
MOTHER, MARY and JOSEPH. *w*h*a*a*a*a*a*a*t* is this, and why do you do
What is with the number of '@'s threatening to exceed the rest of the
letters by a simple majority? ... I hope I don't seem too naive to bother
with, but I'm mostly not sure of the difference between "@@@" and "@@@ --" .
Any help, clue, even criticism is welcomed in reply.
Many happy returns of the day ...
"Nothing succeeds like success."
Brad Morrison, firstname.lastname@example.org
"Press to test."
"Release to detonate."