I expect I'm doing something very basic fundamentally wrong but I am quite new to OraDev.
I am trying to learn about variables in PL/SQL, I have Oracle 10g as my back-end database and OraDev as my IDE. Here is the generic query I'm fiddling with
Code: Select all
*SET SERVEROUTPUT ON declare v_val number := 0; v_cnt NUMBER := 0; begin SELECT COUNT(*) INTO v_cnt FROM dual WHERE v_val IN (select 0 from dual); if (v_cnt > 0) then **dbms_output.enable(buffer_size => NULL); dbms_output.put_line(v_cnt); dbms_output.disable; end if; end;
I want to output the results of my PL/SQL block to my screen, much as one would to the Immediate Window in VBA, I am having some problems though.
*When I use SET SERVEROUTPUT ON I am getting the error message "SQL Plus command 'SET' not supported".
I do not understand why I am getting this error message?? Anyway I replaced it with **dbms_output.enable(buffer_size => NULL);
This seems to run fine but I am just getting the following Output, and not the v_cnt variable value as expected. Am I doing something wrong? Am I looking in the wrong place (the Output window)? Does OraDev not support this? Have I got a dodgy install?
------ Execution started: SQL1.sql ------
Execute succeeded [0.092 s]
------------ Done: SQL1.sql -------------
SQL1.sql: Execute succeeded [0.092 s]
I'd really appreciate some advice on this I do not understand what is causing the problem.