3. To verify, paste the following into another worksheet and Run Script (F5)
SET DEFINE OFF CREATE OR REPLACE PROCEDURE myproc IS v_txt VARCHAR (10); BEGIN v_txt := '&abc'; dbms_output.put_line(v_txt); END;
Note that set define on|off|<value> works, but show define always displays define "<value>" regardless of whether off or on is in effect, so SQL Developer has a slight incompatibility with SQL*Plus there.
set serveroutput on exec myproc ...to see the following in the Script Output pane... anonymous block completed &abc
1)can I use same thing in sql plus also?Almost. To use the exact same file for both SQL Developer and SQL*Plus, just add "/" terminator after the procedure. SQL*Plus requires it, and will compile it once; SQL Developer will compile it twice, but no harm done.
2)and i think people might be using 10 or 9 so it should be compitable with that also. my script may be run on those systems also?I do not have time to test for you (of course, you should do that!), but I suspect the rules about SQL and PL/SQL statement termination have been stable for a very long time.