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

Home -> Community -> Usenet -> c.d.o.server -> Re: syntax - query's scalar results to a varible?

Re: syntax - query's scalar results to a varible?

From: <matt_at_mailinator.com>
Date: 7 Jul 2006 11:42:38 -0700
Message-ID: <1152297758.067743.115940@m79g2000cwm.googlegroups.com>


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 Received on Fri Jul 07 2006 - 13:42:38 CDT

Original text of this message

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