Re: !!!Need help with stored pros
Date: 1995/06/15
Message-ID: <lfeges.22.2FDFEB1B_at_hookup.net>#1/1
In article <3rh97l$aef_at_hippo.shef.ac.uk> Martin Rapier <m.rapier_at_sheffield.ac.uk> writes:
>From: Martin Rapier <m.rapier_at_sheffield.ac.uk>
>Subject: Re: !!!Need help with stored pros
>Date: 12 Jun 1995 11:42:45 GMT
>martinj_at_pi.net wrote:
>>
>>> I created a simple stored procedure that selects a count(*)>> from a table
>using a where clause. I then tested the value of >> th=
>e count to see if there is data or not. I am using SQL Plus>> to test the
>procedure. If the table has data or not, >> the procedure =
>executed successfully.>
Look into using a package called DBMS_OUTPUT. Here's a sample:
- this is sqlplus set serveroutput on size 9999; -- tells DBMS engine to enable output to the 'spool file'
spool out.lst;
--this PLSQL
DECLARE
ct_rec NUMBER(9);
Cursor C1 is SELECT COUNT(*) from USER_TABLES;
BEGIN
Open C1;
Fetch C1 into ct_rec;
Close C1;
DBMS_OUTPUT.PUT_LINE('No of recs=' || ct_rec); END;
- end of sample
Good luck!
\lf Received on Thu Jun 15 1995 - 00:00:00 CEST