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

Home -> Community -> Mailing Lists -> Oracle-L -> SV: Simple? PL/SQL query

SV: Simple? PL/SQL query

From: Per Berghäll <Per.Berghall_at_linadb.se>
Date: Mon, 4 Sep 2000 16:12:05 +0200
Message-Id: <10609.116153@fatcity.com>


------_=_NextPart_001_01C0167A.1C3B70E0
Content-Type: text/plain;

        charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable

Hi Sean,
You should enter: 'set serveroutput on;', before you run your code.

> Med v=E4nliga h=E4lsningar/ Kind regards



 <<...>> Link=F6pings Adb-konsult AB
Per Bergh=E4ll
Adress: L=E5sblecksgatan 3

               589 41 Link=F6ping
Tel : +46 (0)13-362600=20
Fax : +46 (0)13-362625
Email: mailto:per.berghall_at_linadb.se
Internet: http://www.linadb.se


> ----------
> Fr=E5n: O'Neill, Sean[SMTP:Sean.ONeill_at_organon.ie]
> Svara till: ORACLE-L_at_fatcity.com
> Skickat: Monday, September 04, 2000 4:41 PM
> Till: Multiple recipients of list ORACLE-L
> Ang=E5ende: Simple? PL/SQL query

>=20
> I'm new to PL/SQL and I am trying to use same to send output of name =
from
> v$database to screen. The code I'm using is as below but the output =
is
> not
> being sent to screen and I can't figure why not. The code is =
replying
> with
> "PL/SQL procedure successfully completed." in SQL*Plus. Maybe this =
is not
> the most appropriate way to approach this requirement and alternative
> method
> inputs are welcome too!. Are there any other ways to send output to
> screen
> aside from DBMS_OUTPUT?

>=20

> DECLARE
>=20

> db_name varchar2(20);
>=20

> BEGIN
> SELECT name =20
> INTO db_name
> FROM v$database;
> DBMS_OUTPUT.PUT_LINE
> ( 'Database name is ' || db_name );
> END;
>=20

> /
>=20
>=20

> Sean :)
>=20

> ###### ###### ###### ######=20
> # # # # # # # # Rookie
> #### # # ###### ###### Data
> # # # # # # # # Base=20
> # # ####### ###### # # Adminstrator
> -------------------------------- ------------=20
> Organon (Ireland) Ltd.
> E-mail: sean.oneill_at_organon.ie [subscribed: Digest Mode]
>=20
> The only man who never makes a mistake is the man who never does =
anything.
> - Theodore Roosevelt
>=20

> --=20
> Author: O'Neill, Sean
> INET: Sean.ONeill_at_organon.ie
>=20

> Fat City Network Services -- (858) 538-5051 FAX: (858) 538-5051
> San Diego, California -- Public Internet access / Mailing =
Lists
> --------------------------------------------------------------------
> To REMOVE yourself from this mailing list, send an E-Mail message
> to: ListGuru_at_fatcity.com (note EXACT spelling of 'ListGuru') and in
> the message BODY, include a line containing: UNSUB ORACLE-L
> (or the name of mailing list you want to be removed from). You may
> also send the HELP command for other information (like subscribing).
>=20

------_=_NextPart_001_01C0167A.1C3B70E0
Content-Type: text/html;

        charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2//EN">
<HTML>
<HEAD>
<META HTTP-EQUIV=3D"Content-Type" CONTENT=3D"text/html; =
charset=3Diso-8859-1">
<META NAME=3D"Generator" CONTENT=3D"MS Exchange Server version = 5.5.2650.12">
<TITLE>SV: Simple? PL/SQL query</TITLE>
</HEAD>
<BODY>

<P><FONT COLOR=3D"#0000FF" SIZE=3D2 FACE=3D"Arial">Hi Sean,</FONT> <BR><FONT COLOR=3D"#0000FF" SIZE=3D2 FACE=3D"Arial">You should enter: = 'set serveroutput on;', before you run your code.</FONT> </P>

<P><FONT SIZE=3D2 FACE=3D"Arial">Med v=E4nliga h=E4lsningar/ Kind = regards</FONT>
<BR><FONT SIZE=3D2 FACE=3D"MS Sans =

Serif">**************************************************</FONT>
<BR><B><I><FONT FACE=3D"Arial" SIZE=3D2 COLOR=3D"#000000"> = &lt;&lt;...&gt;&gt; </FONT></I></B><B><I><FONT = FACE=3D"Arial"></FONT></I></B><B><I> <FONT FACE=3D"Times New = Roman">Link=F6pings Adb-konsult AB</FONT></I></B><B></B> <BR><FONT COLOR=3D"#000080" SIZE=3D2 FACE=3D"MS Sans Serif">Per = Bergh=E4ll</FONT>
<BR><B><FONT COLOR=3D"#000080" SIZE=3D2 FACE=3D"MS Sans = Serif">Adress:</FONT></B><FONT COLOR=3D"#000080" SIZE=3D2 FACE=3D"MS = Sans Serif"> L=E5sblecksgatan 3</FONT>
<BR><FONT COLOR=3D"#000080" SIZE=3D2 FACE=3D"MS Sans = Serif">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp= ;&nbsp;&nbsp;&nbsp; 589 41 Link=F6ping</FONT> <BR><B><FONT COLOR=3D"#000080" SIZE=3D2 FACE=3D"MS Sans Serif">Tel = :</FONT></B><FONT COLOR=3D"#000080" SIZE=3D2 FACE=3D"MS Sans Serif"> = +46 (0)13-362600 </FONT>
<BR><B><FONT COLOR=3D"#000080" SIZE=3D2 FACE=3D"MS Sans Serif">Fax = :</FONT></B><FONT COLOR=3D"#000080" SIZE=3D2 FACE=3D"MS Sans Serif"> = +46 (0)13-362625</FONT>
<BR><B><FONT COLOR=3D"#000080" SIZE=3D2 FACE=3D"MS Sans = Serif">Email:</FONT></B><B><U> <FONT COLOR=3D"#0000FF" SIZE=3D2 = FACE=3D"MS Sans Serif"><A =
HREF=3D"mailto:per.berghall_at_linadb.se">mailto:per.berghall_at_linadb.se</A>=
</FONT></U></B><B></B>
<BR><B><FONT COLOR=3D"#000080" SIZE=3D2 FACE=3D"MS Sans =
Serif">Internet:</FONT></B><B><U> <FONT COLOR=3D"#0000FF" SIZE=3D2 =
FACE=3D"MS Sans Serif"><A HREF=3D"http://www.linadb.se" = TARGET=3D"_blank">http://www.linadb.se</A></FONT></U></B> <BR><FONT SIZE=3D2 FACE=3D"MS Sans =
Serif">**************************************************</FONT>
</P>
<UL>
<P><FONT SIZE=3D2 FACE=3D"MS Sans Serif">----------</FONT>
<BR><B><FONT SIZE=3D2 FACE=3D"MS Sans Serif">Fr=E5n:</FONT></B> &nbsp; = <FONT SIZE=3D2 FACE=3D"MS Sans Serif">O'Neill, = Sean[SMTP:Sean.ONeill_at_organon.ie]</FONT> <BR><B><FONT SIZE=3D2 FACE=3D"MS Sans Serif">Svara till:</FONT></B> = &nbsp;&nbsp;&nbsp; <FONT SIZE=3D2 FACE=3D"MS Sans = Serif">ORACLE-L_at_fatcity.com</FONT>
<BR><B><FONT SIZE=3D2 FACE=3D"MS Sans Serif">Skickat:</FONT></B> = &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <FONT SIZE=3D2 FACE=3D"MS Sans = Serif">Monday, September 04, 2000 4:41 PM</FONT> <BR><B><FONT SIZE=3D2 FACE=3D"MS Sans Serif">Till:</FONT></B> &nbsp; = <FONT SIZE=3D2 FACE=3D"MS Sans Serif">Multiple recipients of list = ORACLE-L</FONT>
<BR><B><FONT SIZE=3D2 FACE=3D"MS Sans Serif">Ang=E5ende:</FONT></B> = &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <FONT SIZE=3D2 FACE=3D"MS Sans = Serif">Simple? PL/SQL query</FONT>
</P>

<P><FONT SIZE=3D2 FACE=3D"Arial">I'm new to PL/SQL and I am trying to = use same to send output of name from</FONT> <BR><FONT SIZE=3D2 FACE=3D"Arial">v$database to screen.&nbsp; The code = I'm using is as below but the output is not</FONT> <BR><FONT SIZE=3D2 FACE=3D"Arial">being sent to screen and I can't = figure why not.&nbsp; The code is replying with</FONT> <BR><FONT SIZE=3D2 FACE=3D"Arial">&quot;PL/SQL procedure successfully = completed.&quot; in SQL*Plus.&nbsp; Maybe this is not</FONT> <BR><FONT SIZE=3D2 FACE=3D"Arial">the most appropriate way to approach = this requirement and alternative method</FONT> <BR><FONT SIZE=3D2 FACE=3D"Arial">inputs are welcome too!.&nbsp; Are = there any other ways to send output to screen</FONT> <BR><FONT SIZE=3D2 FACE=3D"Arial">aside from DBMS_OUTPUT?</FONT> </P>

<P><FONT SIZE=3D2 FACE=3D"Arial">DECLARE</FONT> </P>

<P><FONT SIZE=3D2 FACE=3D"Arial">db_name varchar2(20);</FONT> </P>

<P><FONT SIZE=3D2 FACE=3D"Arial">BEGIN</FONT>
<BR><FONT SIZE=3D2 FACE=3D"Arial">&nbsp;&nbsp;&nbsp; SELECT name&nbsp; =
</FONT>
<BR><FONT SIZE=3D2 =

FACE=3D"Arial">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; INTO = db_name</FONT>
<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <FONT SIZE=3D2 = FACE=3D"Arial">FROM v$database;</FONT>
<BR><FONT SIZE=3D2 =
FACE=3D"Arial">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; = DBMS_OUTPUT.PUT_LINE</FONT>
<BR><FONT SIZE=3D2 =
FACE=3D"Arial">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ( 'Database = name is ' || db_name );</FONT>
<BR><FONT SIZE=3D2 FACE=3D"Arial">END;</FONT> </P>
<P><FONT SIZE=3D2 FACE=3D"Arial">/</FONT>
</P>
<BR>

<P><FONT SIZE=3D2 FACE=3D"Arial">Sean :)</FONT> </P>

<P><FONT SIZE=3D2 FACE=3D"Arial">######&nbsp;&nbsp; ######&nbsp; = ######&nbsp; ###### </FONT>
<BR><FONT SIZE=3D2 FACE=3D"Arial">#&nbsp;&nbsp;&nbsp; #&nbsp;&nbsp; = #&nbsp;&nbsp;&nbsp; #&nbsp; #&nbsp;&nbsp;&nbsp; #&nbsp; = #&nbsp;&nbsp;&nbsp; #&nbsp; Rookie</FONT> <BR><FONT SIZE=3D2 FACE=3D"Arial">####&nbsp;&nbsp;&nbsp;&nbsp; = #&nbsp;&nbsp;&nbsp; #&nbsp; ######&nbsp; ######&nbsp; Data</FONT> <BR><FONT SIZE=3D2 FACE=3D"Arial">#&nbsp;&nbsp; #&nbsp;&nbsp;&nbsp; = #&nbsp;&nbsp;&nbsp; #&nbsp; #&nbsp;&nbsp;&nbsp; #&nbsp; = #&nbsp;&nbsp;&nbsp; #&nbsp; Base </FONT> <BR><FONT SIZE=3D2 FACE=3D"Arial">#&nbsp;&nbsp;&nbsp; #&nbsp; = #######&nbsp; ######&nbsp; #&nbsp;&nbsp;&nbsp; #&nbsp; = Adminstrator</FONT>

<BR><FONT SIZE=3D2 FACE=3D"Arial">-------------------------------- =
------------ </FONT>
<BR><FONT SIZE=3D2 FACE=3D"Arial">Organon (Ireland) Ltd.</FONT> <BR><FONT SIZE=3D2 FACE=3D"Arial">E-mail: = sean.oneill_at_organon.ie&nbsp;&nbsp; [subscribed: Digest Mode]</FONT> </P>

<P><FONT SIZE=3D2 FACE=3D"Arial">The only man who never makes a mistake = is the man who never does anything.</FONT> <BR><FONT SIZE=3D2 FACE=3D"Arial">&nbsp;- Theodore Roosevelt</FONT> </P>

<P><FONT SIZE=3D2 FACE=3D"Arial">-- </FONT>
<BR><FONT SIZE=3D2 FACE=3D"Arial">Author: O'Neill, Sean</FONT>
<BR><FONT SIZE=3D2 FACE=3D"Arial">&nbsp; INET: =
Sean.ONeill_at_organon.ie</FONT>
</P>

<P><FONT SIZE=3D2 FACE=3D"Arial">Fat City Network = Services&nbsp;&nbsp;&nbsp; -- (858) 538-5051&nbsp; FAX: (858) = 538-5051</FONT>
<BR><FONT SIZE=3D2 FACE=3D"Arial">San Diego, = California&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; -- Public Internet = access / Mailing Lists</FONT>
<BR><FONT SIZE=3D2 =

FACE=3D"Arial">---------------------------------------------------------=
-----------</FONT>
<BR><FONT SIZE=3D2 FACE=3D"Arial">To REMOVE yourself from this mailing = list, send an E-Mail message</FONT>
<BR><FONT SIZE=3D2 FACE=3D"Arial">to: ListGuru_at_fatcity.com (note EXACT = spelling of 'ListGuru') and in</FONT>
<BR><FONT SIZE=3D2 FACE=3D"Arial">the message BODY, include a line = containing: UNSUB ORACLE-L</FONT>
<BR><FONT SIZE=3D2 FACE=3D"Arial">(or the name of mailing list you want = Received on Mon Sep 04 2000 - 09:12:05 CDT

Original text of this message

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