Path: dp-news.maxwell.syr.edu!spool.maxwell.syr.edu!news-spur1.maxwell.syr.edu!news.maxwell.syr.edu!postnews.google.com!m79g2000cwm.googlegroups.com!not-for-mail
From: matt@mailinator.com
Newsgroups: comp.databases.oracle.server
Subject: Re: syntax - query's scalar results to a varible?
Date: 7 Jul 2006 11:42:38 -0700
Organization: http://groups.google.com
Lines: 45
Message-ID: <1152297758.067743.115940@m79g2000cwm.googlegroups.com>
References: <1151961674.498148.323250@h44g2000cwa.googlegroups.com>
   <ut2ja2pgtie1i6bonsu8m62e1h477157s8@4ax.com>
   <1152113110.784774.234160@b68g2000cwa.googlegroups.com>
   <vo0oa25lvadknvhpp2jr40j8hgb8vkb5uj@4ax.com>
NNTP-Posting-Host: 134.163.253.126
Mime-Version: 1.0
Content-Type: text/plain; charset="iso-8859-1"
X-Trace: posting.google.com 1152297762 22390 127.0.0.1 (7 Jul 2006 18:42:42 GMT)
X-Complaints-To: groups-abuse@google.com
NNTP-Posting-Date: Fri, 7 Jul 2006 18:42:42 +0000 (UTC)
In-Reply-To: <vo0oa25lvadknvhpp2jr40j8hgb8vkb5uj@4ax.com>
User-Agent: G2/0.2
X-HTTP-UserAgent: Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.8.0.4) Gecko/20060508 Firefox/1.5.0.4,gzip(gfe),gzip(gfe)
Complaints-To: groups-abuse@google.com
Injection-Info: m79g2000cwm.googlegroups.com; posting-host=134.163.253.126;
   posting-account=59uCjQ0AAADOOe3Tqs7UfOdEKKZ1o9cJ
Xref: dp-news.maxwell.syr.edu comp.databases.oracle.server:270608

Andy Hassall wrote:
>  Look up DBMS_OUTPUT.

ok, ive looked that up, and read several posts & pages, including this
one:

http://www.psoug.org/reference/dbms_output.html

...still having trouble w/ it. i am working w/ a "sql edit" console in
Toad, on what i am told is Oracle 9. can you help clarify how one does
this?

i had thought it would be something like:

	SET serveroutput ON;
	EXEC dbms_output.enable;

	--define variable
	DECLARE v_roleID INTEGER;

	--assign value to variable (based on input parameter's roleName)
	BEGIN
		SELECT u.RoleID INTO v_roleID FROM edd_tblRoles u WHERE u.RoleName =
'Admin';
	END;


	--attempt to display contents of variable (for immediate debugging
satisfaction)
	BEGIN
		dbms_output.put_line(v_roleID);
	END;


...but thats not it -- it hilites "serveroutput" and states "missing or
invalid option". ive tried other variations as well, w/ begin/end
blocks. no go.

am i going about this correctly? can you show how this is done
properly?


thanks,
matt

