Re: More PL-SQL I/O frustration!

From: Martin Farber <farber_at_nynexst.com>
Date: 1995/09/27
Message-ID: <44cluh$mm_at_news.nynexst.com>#1/1


As far as I can tell, PL/SQL only flushes the buffer upon the termination, successful or unsuccessful, of the procedure. One solution might be to write to an Oracle pipe and have a receiving process read the pipe, output the result, and terminate.

One thing that bugged me, was that when I ^C out of a procedure that writes to dbms_output - I wasn't getting my output at all!! I persisted and discovered that a simple: EXEX NULL; seemed to do the trick!!! It's like drain-o, the pipe drains completely after that.

Happy computing!!!

Sincerely,

Martin Farber
Independent Oracle Consultant "A Jack of all trades and a slave to one."

                        |  NYNEX Science & Technology
                        |  500 Westchester Ave, Rm 1B-23
                        |  White Plains, NY  10604
                        |     -----------------
                        |  email: farber_at_nynexst.com
                        |  Voice: 914/644-2656
                        |    FAX: 914/644-2216

In article 39h_at_govonca3.gov.on.ca, frampton_at_admin.flarc.edu.on.ca (Steve Frampton, Computer Operator/Systems Clerk) writes:
>Hello:
>
>Once again, I am becoming frustrated with the kludgy way PL/SQL seems to
>be put together (someday I'll put together a "mini-faq" of my experiences!)
>
>I am writing an application that builds a 12-month calendar, replete with
>absence information. Somehow I got this thing to work...but now that I
>am dealing with a *lot* of output, PL/SQL is getting testy again.
>
>I'm using the dbms_output.put_line package to display the results (by the
>way, when this is done, I'd like the output to go to a file -- is that
>easily done with a "spool on" or something?). One, two, hey, even four
>calendars are displayed with no problem.
>
>Then..."buffer overflow, limit of 2000 bytes". No problem, you say. Just
>use the enable procedure to set a higher buffer limit. Okay -- 4000 bytes
>gets me a little further, now I can see 8 months! 6000 bytes...just leads
>to the same error, this time no output. 10000 bytes...no output. D'oh!!!
>
>Okay...so instead of increasing the buffer size, I tried writing a "trash"
>procedure, which uses the dbms_output.get_line procedure (to retrieve a
>line from the buffer). In my "trash" procedure, I loop, removing lines,
>until no lines are left in the buffer. But I no longer receive any output!
>
>(As an aside, I also have found no way of requesting input from the user).
>
>So -- what's up with I/O in PL-SQL!?!?!?!? I am getting tempted to use
>kludgy temporary tables, something that will make my code even more
>difficult to read and ugly than it is now.
>
>Any information would be greatly appreciated.
>
>-------------------------------------------------------------------------------
>This article contains my own words formed by my own opinions. I speak on my
>own behalf and my views do not necessarily agree with those of my employer.
>-----------------------------------+-------------------------------------------
>Steve Frampton | Phone: (613) 544-4927, extension 331
>Computer Operator/Systems Clerk | Fax: (613) 530-4761
>Frontenac-Lennox & Addington RCSSB | E-mail: frampton_at_admin.flarc.edu.on.ca
>-----------------------------------+-------------------------------------------
>-------------------------------------------------------------------------------
>This article contains my own words formed by my own opinions. I speak on my
>own behalf and my views do not necessarily agree with those of my employer.
>-----------------------------------+-------------------------------------------
>Steve Frampton | Phone: (613) 544-4927, extension 331
>Computer Operator/Systems Clerk | Fax: (613) 530-4761
>Frontenac-Lennox & Addington RCSSB | E-mail: frampton_at_admin.flarc.edu.on.ca
>-----------------------------------+-------------------------------------------
Received on Wed Sep 27 1995 - 00:00:00 CET

Original text of this message