Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.server -> Re: syntax - query's scalar results to a varible?
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