0

In Oracle, can I write dbms_output to a literal control or label control in Asp.net? I need to create a report which would render in a literal control.

MatthewMartin
  • 32,326
  • 33
  • 105
  • 164
Nisar
  • 5,708
  • 17
  • 68
  • 83

1 Answers1

1

Theoretically, I'm sure you could. You'd have to write the appropriate dbms_output.get_line calls to read from the buffer (assuming, of course, that you allocated a large enough buffer before calling the procedure that wrote the data to the dbms_output buffer).

Just because it is possible, though, does not mean that it is a good idea. Using dbms_output to create a report is absolutely the wrong architectural approach. dbms_output is useful for printing the occasional debugging message. It is a very poor solution to generating a report let alone generating data that will be rendered in a GUI. It will break if you didn't allocate a large enough buffer ahead of time, it will break if some other piece of code happens to add some debugging dbms_output calls, and it means that you're writing a bunch of code to fetch the data rather than using built-in controls which means more code for you to write, debug, and maintain and that your system will be very unique which means that it will take others much longer to understand it.

Justin Cave
  • 227,342
  • 24
  • 367
  • 384
  • @NisarMohammed - I'm afraid that I don't understand the business problem you're trying to solve which makes it difficult to come up with alternatives. Is there a reason that you can't return, say, a `sys_refcursor` from your function and then render that into a simple HTML report in your front end? That would be a much more natural architecture. – Justin Cave Apr 24 '14 at 16:46