Re: A PL\SQL Questions
From: David Fitzjarrell <oratune_at_msn.com>
Date: 6 Aug 2001 14:13:53 -0700
Message-ID: <32d39fb1.0108061313.2ab5be96_at_posting.google.com>
Date: 6 Aug 2001 14:13:53 -0700
Message-ID: <32d39fb1.0108061313.2ab5be96_at_posting.google.com>
- Output the results to the terminal
--
dbms_output.put_line('The number of customer accounts is: '||custct); end; /
rem
rem DBMS_OUTPUT.PUT example
rem
rem
rem Enable output
rem
set serveroutput on size 1000000
declare
--
- Declare cursor to return count of
- valid customer accounts
--
cursor custaccts is select count(*) from customer_accounts;
--
- Variable to 'hold' returned count
--
custct number:=0;
--
- Variable to 'hold' current date/time
--
currdt date; begin
--
- Open the cursor
--
open cursor custaccts;
--
- Fetch the value into the declared variable
--
fetch custaccts into custct;
--
- Close the cursor
--
close custaccts;
--
- Get current date
--
select sysdate into currdt from dual;
--
- Output the results to the terminal
--
dbms_output.put('The number of customer accounts is: '||custct); dbms_output.put_line(' for period ending: '||currdt); end; /
David Fitzjarrell
"Steve Long" <slong3_at_mediaone.net> wrote in message news:<DNyb7.164$PE5.41026_at_typhoon.jacksonville.mediaone.net>...
> look up dbms.output and dbmsw.putline > > "Frank" <fcolon_at_onebox.com> wrote in message > news:3271719f.0108031221.77749dec_at_posting.google.com... > > Quick question....is there a way to get a PL\SQL query to print some text? > > > > For example, if I had the query: > > > > Select count(*) from customer_accounts; (will return a count of 10) > > > > How can I change that query so that the following prints out: > > > > The number of cusomter accounts is: 10 > > > > Thanks. > > > > --Frank > > > > P.S. Do you know of any good PL\SQL resources on the net?Received on Mon Aug 06 2001 - 23:13:53 CEST