Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.misc -> Re: beginner question
That really depends on what you want to do with the output. An
easy(ish) way is to use the DBMS_OUTPUT package.
Check out the help on the package for the details. It has a few "problems". It doesn't output until the PL/SQL block finishes and it has an upper maximum of bytes it can output. (see http://download-west.oracle.com/docs/cd/B10501_01/appdev.920/a96612/d_output.htm#ARPLS036)
Depending on what client you're using the viewing pane can accessed in different ways.
DECLARE
day3 DATE := '&day1';
day4 DATE := '&day2';
first_name VARCHAR(10);
last_name VARCHAR(10);
perform_value FLOAT;
CURSOR T1Cursor IS
SELECT E.FIRST, E.LAST,
SUM(SI.QUANTITY_SOLD)/SUM(WS.START_TIME.diff(WS.END_TIME)) AS
PERFORMANCE
FROM DEPT D, EMP E, RECEIPT R, SOLD_ITEMS SI, WORKED_SCHEDULE WS WHERE D.NAME = 'Cashier' AND D.DEPTNUMBER = E.DEPTNUMBER AND R.CASHIERSSN=E.SSN AND R.SALEDATE >= day3 AND R.SALEDATE<=
AND R.RECEIPTNUMBER = SI.RECEIPTNUMBER AND WS.WSSN=E.SSN AND WS.DAY >= day3 AND WS.DAY <= day4GROUP BY E.FIRST, E.LAST;
![]() |
![]() |