Home » SQL & PL/SQL » SQL & PL/SQL » how to print values with scripts
how to print values with scripts [message #194102] Wed, 20 September 2006 16:02 Go to next message
miroconnect@yahoo.com
Messages: 202
Registered: April 2006
Senior Member
I have a script

declare


v_new_sys_org_id number;

v_new_app_num FG_application.app_num%TYPE;

begin

select app_num , sys_org_id into v_new_app_num , v_new_sys_org_id from fg_application where sys_app_id=v_new_sys_app_id;

DBMS_OUTPUT.PUT_LINE('v_new_app_num'||v_new_app_num );
commit;
DBMS_OUTPUT.PUT_LINE('v_new_app_num'||v_new_app_num );
end;
I have some
dbms_out_put_line but I never get any printout
when I execute the script .
Please guide me how can I bring printouts on screen.
Re: how to print values with scripts [message #194103 is a reply to message #194102] Wed, 20 September 2006 16:19 Go to previous messageGo to next message
ebrian
Messages: 2794
Registered: April 2006
Senior Member
Prior to running your script, you need to issue:

set serveroutput on


No commit is needed.

[Updated on: Wed, 20 September 2006 16:20]

Report message to a moderator

Re: how to print values with scripts [message #194104 is a reply to message #194103] Wed, 20 September 2006 16:24 Go to previous messageGo to next message
miroconnect@yahoo.com
Messages: 202
Registered: April 2006
Senior Member
Could you guide me how to set server output on
Re: how to print values with scripts [message #194105 is a reply to message #194104] Wed, 20 September 2006 16:33 Go to previous messageGo to next message
ebrian
Messages: 2794
Registered: April 2006
Senior Member
It's set in SQL*Plus:

SQL> set serveroutput on
SQL> @yourscript.sql
Re: how to print values with scripts [message #194118 is a reply to message #194102] Wed, 20 September 2006 17:23 Go to previous message
shell
Messages: 3
Registered: January 2000
Junior Member
on sql prompt
SQL> Set serveroutput on
SQL>declare
v_new_sys_org_id number;
v_new_app_num FG_application.app_num%TYPE;
begin
select app_num
, sys_org_id
into v_new_app_num
, v_new_sys_org_id
from fg_application
where sys_app_id=v_new_sys_app_id;

DBMS_OUTPUT.PUT_LINE('v_new_app_num'||v_new_app_num );

DBMS_OUTPUT.PUT_LINE('v_new_app_num'||v_new_app_num );
end;
no need to commit
Previous Topic: cusor ,trigger
Next Topic: declaring variables in a script
Goto Forum:
  


Current Time: Fri Dec 09 01:58:05 CST 2016

Total time taken to generate the page: 0.05341 seconds