Win has asked for the wisdom of the Perl Monks concerning the following question:

This node falls below the community's minimum standard of quality and will not be displayed.

Replies are listed 'Best First'.
Re: ALTER SPROC activation
by jfroebe (Parson) on Sep 19, 2005 at 13:56 UTC
    simplest:
    isql -U<login> -i <script_file>

    of course, you could do it in a perl script like so:

    update: corrected code

    while (my $line = <$FH>) { my $batch; do { $batch .= $line; last unless $line = <$FH>; } until ($line =~ m/^\s*go\s*$/i); $dbh->do($batch) if ($line =~ m/^\s*go\s*$/i); }

    Jason L. Froebe

    Team Sybase member

    No one has seen what you have seen, and until that happens, we're all going to think that you're nuts. - Jack O'Neil, Stargate SG-1

      Your code requires two <FH> in a row to properly exit. You can't rely on that if FH is a device. Maybe you should use last OUTER and label the while loop as OUTER?

        yup you're right! thanks! :)

        Jason L. Froebe

        Team Sybase member

        No one has seen what you have seen, and until that happens, we're all going to think that you're nuts. - Jack O'Neil, Stargate SG-1

      A reply falls below the community's threshold of quality. You may see it by logging in.
    A reply falls below the community's threshold of quality. You may see it by logging in.
Re: ALTER SPROC activation
by Fletch (Bishop) on Sep 19, 2005 at 13:42 UTC

    Well, judging by the code you've posted showing what you've already done . . .

    Oh, never mind.

    A reply falls below the community's threshold of quality. You may see it by logging in.