Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.misc -> beginner question

beginner question

From: Someonekicked <someonekicked_at_comcast.net>
Date: Wed, 5 Apr 2006 00:02:12 -0400
Message-ID: <M9mdneBzpK_b3K7ZRVn-qw@comcast.com>


how can I output (to the screen) the result from a cursor..

I am stuck! everywhere online they show how you can do operations on the cursor result, but what about just output that result????

here is my code:

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 <= 
day4
          AND R.RECEIPTNUMBER = SI.RECEIPTNUMBER
          AND WS.WSSN=E.SSN AND WS.DAY >= day3 AND WS.DAY <= day4
GROUP BY E.FIRST, E.LAST;
BEGIN
OPEN T1Cursor;
LOOP
FETCH T1Cursor INTO first_name, last_name, perform_value; EXIT WHEN T1Cursor%NOTFOUND;
END LOOP;
CLOSE T1Cursor;
END;
.
run;
01-Apr-06
10-Apr-06
-- 
Quotes from The Weather Man:
Robert Spritz: Do you know that the harder thing to do, and the right thing
to do, are usually the same thing? "Easy" doesn't enter into grown-up
life... to get anything of value, you have to sacrifice. 
Received on Tue Apr 04 2006 - 23:02:12 CDT

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US