Correct, they are not needed there.
Also, you don't need the complexity (and the performance penalty) of:
"execute immediate" if you just want to call dbms_output.put_line.
What do you mean though by "not working"? Did you "set serveroutput on"
before running this in SQL*Plus?
You know that the output from this will *NOT* be displayed as each
record is fetched, but only after the block exits, right?
-----Original Message-----
From: Stephen Price
[mailto:oracledba-ezmlmshield-x68755779.[Email address protected]
Sent: Wednesday, October 31, 2007 8:59 AM
To: LazyDBA Discussion
Subject: RE: PL/SQL Help
I don't believe you need the BEGIN---END in an EXECUTE statement... do
you?
Stephen Price
Oracle Database Administrator
Compusearch Software Systems, Inc.
-----Original Message-----
From: Luis Cardenas
[mailto:oracledba-ezmlmshield-x33720660.[Email address protected]
Sent: Wednesday, October 31, 2007 8:54 AM
To: LazyDBA Discussion
Subject: PL/SQL Help
Anyone:
This bit of pl is not working:
BEGIN
FOR arec IN (SELECT SID, SERIAL# FROM V$SESSION)
LOOP
EXECUTE IMMEDIATE ''BEGIN dbms_output.put_line(arec.sid); END;'';
END LOOP;
END;
Can ne1 spot the reason please?
Thanks,
Luis
-----------------------------------------
This e-mail is sent on behalf of Trader Media Group Limited,
registered office: Unit 6, Thatcham Business Village, Colthrop
Lane, Thatcham, Berkshire RG19 4LW (Registered in England No.
4768840). This email and any files transmitted with it are
confidential and intended solely for the use of the individual or
entity to whom they are addressed. If you have received this email
in error please notify the sender. This email message has been
swept for the presence of computer viruses. www.ciphertrust.com
---------------------------------------------------------------------
TO REPLY TO EVERYBODY , PLEASE CLICK REPLY-ALL, NOT JUST REPLY
To post a dba job: http://jobs.lazydba.com
To Subscribe : http://www.LazyDBA.com
To unsubscribe: http://www.lazydba.com/unsubscribe.html
---------------------------------------------------------------------
TO REPLY TO EVERYBODY , PLEASE CLICK REPLY-ALL, NOT JUST REPLY
To post a dba job: http://jobs.lazydba.com
To Subscribe : http://www.LazyDBA.com
To unsubscribe: http://www.lazydba.com/unsubscribe.html
THE INFORMATION CONTAINED IN THIS E-MAIL MESSAGE AND ANY ATTACHMENTS SENT FROM GENTEX CORPORATION IS GENTEX CONFIDENTIAL INFORMATION INTENDED ONLY FOR THE PERSONAL USE OF THE INDIVIDUAL OR ENTITY NAMED ABOVE. If you are not the intended recipient, you are hereby notified that any review, distribution, or copying of this communication is strictly prohibited. If you have received this communication in error, please immediately notify the sender by return e-mail, and delete this e-mail message and any attachments from your computer.
Oracle LazyDBA home page