OraDevelop Studio version 2.55.149 can not show output

OraDevelop Studio version 2.55.149 can not show output

Postby berlinhammer » Tue 24 Aug 2010 12:56

Hello All,

First post! :)

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.

Many thanks,

Jon
berlinhammer
 
Posts: 2
Joined: Tue 24 Aug 2010 12:38

Postby Viktor » Wed 25 Aug 2010 12:15

Hi,
SQL Plus commands are not supported. SET SERVEROUTPUT ON command is ignored.

To view the results through dbms_output, select the Enable DBMS output option.
On the Advanced tab of the Database Connection Properties dialog, select "Enable DBMS output".
See the results in Output - Database tab.

for example:
Code: Select all
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);
    end if;
end;
Viktor
Devart Team
 
Posts: 68
Joined: Thu 06 May 2010 08:12


Return to dbForge for Oracle