![]() | |
![]() |
| | Thread Tools | Display Modes |
#1
| |||
| |||
|
#2
| |||
| |||
|
|
put_line places data into buffer. this data is displayed as soon as pl/sql code is finished and control returns to invoking environment (eg. sqlplus). in some sense the display via put_line is delayed compared to the moment of data availability. is there any other way in oracle, built-in or via third party methods/packages, that controls display from pl/sql code without using the "display buffer", ie. immediately after the data is available? I would greatly appreciate your help and explanations. thank you, geos |
|
Id | Operation | Name | Rows | Cost (%CPU)| Time | ------------------------------------------------------------------- 0 | SELECT STATEMENT | | | 1 (100)| | 1 | SORT AGGREGATE | | 1 | | | |
|
2 | INDEX FULL SCAN| PK_EMP | 14 | 1 (0)| 00:00:01 | ------------------------------------------------------------------- |
#3
| |||
| |||
|
|
So, the answer to your question is no. You cannot asynchronously check the content of the line buffer because Oracle session can execute only a single SQL (or PL/SQL) unit at any given time. If you describe V$SESSION, you will see only the entries describing the current and the previous SQL. That wouldn't be possible, if there was a possibility to have 2 or more simultaneous statements that could be executed by the same session. |
#4
| |||
| |||
|
|
put_line places data into buffer. this data is displayed as soon as pl/sql code is finished and control returns to invoking environment (eg. sqlplus). in some sense the display via put_line is delayed compared to the moment of data availability. is there any other way in oracle, built-in or via third party methods/packages, that controls display from pl/sql code without using the "display buffer", ie. immediately after the data is available? I would greatly appreciate your help and explanations. thank you, geos |
#5
| |||
| |||
|
|
There used to be something called dbms_pipe. |
#6
| |||
| |||
|
|
Gerard H. Pille wrote: There used to be something called dbms_pipe. yes, but his is what I wanted to do (modified example from Feuerstein/Pribyl book, page 111: http://tinyurl.com/6funmrc) session 1: http://geos2005.republika.pl/sesja1.sql session 2: http://geos2005.republika.pl/sesja2.sql pl/sql (2) can "communicate" with pl/sql (1) but the latter one can't display until it is finished. thanks, geos |
#7
| |||
| |||
|
|
session 1: http://geos2005.republika.pl/sesja1.sql session 2: http://geos2005.republika.pl/sesja2.sql pl/sql (2) can "communicate" with pl/sql (1) but the latter one can't display until it is finished. The reading side of dbms_pipe should be handled by a PRO*C or Java program, and spool output immediately. |
#8
| |||
| |||
|
|
Gerard H. Pille wrote: session 1:http://geos2005.republika.pl/sesja1.sql session 2:http://geos2005.republika.pl/sesja2.sql pl/sql (2) can "communicate" with pl/sql (1) but the latter one can't display until it is finished. The reading side of dbms_pipe should be handled by a PRO*C or Java program, and spool output immediately. do I understand right, that Pro*C means running the compiled output as system program, not "inside" sqlplus as it is with anonymous block, and to display the messages appropriate Pro*C "display function" should be used? thank you, geos |
#9
| |||
| |||
|
|
On Oct 6, 2:26 am, geos<g... (AT) nowhere (DOT) invalid> wrote: Gerard H. Pille wrote: session 1:http://geos2005.republika.pl/sesja1.sql session 2:http://geos2005.republika.pl/sesja2.sql pl/sql (2) can "communicate" with pl/sql (1) but the latter one can't display until it is finished. The reading side of dbms_pipe should be handled by a PRO*C or Java program, and spool output immediately. do I understand right, that Pro*C means running the compiled output as system program, not "inside" sqlplus as it is with anonymous block, and to display the messages appropriate Pro*C "display function" should be used? thank you, geos The dbms_pipe package, which should generally not be used in a RAC environment, is a mean to pass data between two Oracle sessions. The first session packs the data into the pipe and the second session unpacks the data from the pipe. Depending on your version you can find information on this Oracle provided package in the PL/SQL Packages and Types manual or Supplied PL/SQL Packages and Types Reference. If you used dbms_pipe instead of dbms_output a pro*C program could unpack the pipe concurrently to the first session filling the pipe and write out the output or insert it into a table independently of the first session transaction. An alternate approach that work in a RAC environment would be to substitute a logging routine for dbms_output where the logging routine was written as an anonymous transaction; however, you would have to read the results from a separate session so neither of these approaches may be of any use if what you want is for the current session to see the dbms_output as it is generated on the current session screen. HTH -- Mark D Powell -- |
#10
| |||
| |||
|
|
Mark D Powell wrote: On Oct 6, 2:26 am, geos<g... (AT) nowhere (DOT) invalid> *wrote: Gerard H. Pille wrote: session 1:http://geos2005.republika.pl/sesja1.sql session 2:http://geos2005.republika.pl/sesja2.sql pl/sql (2) can "communicate" with pl/sql (1) but the latter one can't display until it is finished. The reading side of dbms_pipe should be handled by a PRO*C or Java program, and spool output immediately. do I understand right, that Pro*C means running the compiled output as system program, not "inside" sqlplus as it is with anonymous block, and to display the messages appropriate Pro*C "display function" should be used? thank you, geos The dbms_pipe package, which should generally not be used in a RAC environment, is a mean to pass data between two Oracle sessions. *The first session packs the data into the pipe and the second session unpacks the data from the pipe. *Depending on your version you can find information on this Oracle provided package in the PL/SQL Packages and Types manual or Supplied PL/SQL Packages and Types Reference. If you used dbms_pipe instead of dbms_output a pro*C program could unpack the pipe concurrently to the first session filling the pipe and write out the output or insert it into a table independently of the first session transaction. An alternate approach that work in a RAC environment would be to substitute a logging routine for dbms_output where the logging routine was written as an anonymous transaction; however, you would have to read the results from a separate session so neither of these approaches may be of any use if what you want is for the current session to see the dbms_output as it is generated on the current session screen. HTH -- Mark D Powell -- "anonymous transaction" being "autonomous transaction" ?- Hide quoted text - - Show quoted text - |
![]() |
| Thread Tools | |
| Display Modes | |
| |