SQl Developer  2.1.0.62 - dbms_output.put_line

When trying to use dbms_output.put_line i seem to keep on getting messages in the logging Page tab and example would be:
SEVERE     96     516     oracle.dbtools.db.DBUtil     Invalid column index
This even seems to happen when doing a simple anonymous block witha single dbms_output.put_line command.
I have tried closing SQL Developer and using a new session but same issue.
Is this an install issue or something else?

Dermot,
I too am running on XP.
I am running against a 9i DB in case that should make any difference.
I have as a test switched back to my SQL Developer 1.5.5.59.69 version issued a dbms_output call from a block and it works.
All i am doing is logging on to 9i DB
Opening worksheet
begin
dbms_output.put_line('Test');
END;
I have then chosen View -> DBMS Output
This then open a new a new window at bottom of screen, i then click on the cross to add a new DBMS Output window for my connection.
I then run the code, this is where i now receive the messages in the Loggng Tab.
Have just noticed that when i log into the 9i DB i receive the following in the looging Tab:
SEVERE     103     26830     oracle.dbtools.db.DBUtil     ORA-02248: invalid option for ALTER SESSION
Not sure what is causing this must be part of SQl developer Login procedure failing, but doesn't happen in vesrion 1.5.5.59.69
Thanks
Paul
Edited by: Trotty on Sep 25, 2009 3:44 PM
Edited by: Trotty on Sep 25, 2009 3:56 PM

Similar Messages

  • Debugging in Oracle SQL Developer

    I would like to know how to debug my PL / SQL programs in the Oracle SQL Developer program using breakpoints and such. I've never known how to use debugging tools like this and since this program provides this kind of feature, I was wondering if anyone on here might be able to shine some light on this for me. How are these used? How could I use them to say, figure out what the value of a given variable might be on line whatever? Etc.
    One reason I'm setting out to learn this is because I'm tired of typing DBMS_OUTPUT.PUT_LINE all the time. I would think that there must be a better way than this.
    Lastly (and while we're on that subject), what would cause SQL Developer to not output a DBMS_OUTPUT.PUT_LINE line? I've given this a string of text to output to the monitor and it's not working. It's in the DECLARE section (thinking I could place these almost anywhere my tiny little heart desired, but apparently, I'm wrong?)
    Again, any insight is appreciated.

    - K - :
    Oh, I get it... We had another pesky drop-out fishing for homework cheats again, right?
    Here's a suggestion to make this forum (you know, a place where people come together who all think differently about things both deep and shallow) somewhat more accepting and useful a place for idiots like me who might happen to overlook an apparently obvious "Help" menu item with the glowing neon-colored label heading of "Table of Contents": instead of wasting your own time (let alone, others) by posting silly responses that serve arbitrary agendas for the sake of inflating one's ego and online rep points due to having a bad high school experience, why not just instead take a high road (all the real Oracle kings around here hopefully take) and either ignore the response altogether or post something at least 1% useful. Sound like a plan? Great! For instance, why not inquire about why someone posted something that might not make sense to you? It's an amazing concept...
    Because after all...
    "+I'm often perplexed about the "answers" we get. Seems like you never posted your suggestions.+"
    ...doesn't do a lot for people who come across this thread in similar straights or perspective I was in at the time of creating it.
    That said, something like...
    "+Since you're using Oracle SQL Developer, you should have a 'Help' menu item near the top of the window. Click on it and then click on 'Table of Contents'. Proceed to do as Jim suggested by locating the topic 'Running and Debugging Functions and Procedures'. In that section of the contents, you will find more information about debugging your program, tips and tricks, etc. If this doesn't help you or if you're unsure about something in general, feel free to post back and we'll try to help you further.+"
    ...is much more helpful and succinct. It's welcoming, objective, and very informative (not that Jim's response wasn't).
    On that note, Jim, I do appreciate your response. When I first read your suggestion, I had misinterpreted what you proposed in the heat of the moment. Above all else, I also had some things going on around me that were distracting me. Thanks again. I'm reading the topic right now...

  • Data Miner Extension in SQL Developer 4.0 EA3 Release: EA3 Repository Migration Failure

    The Data Miner extension in the SQL Developer 4.0 EA3 release fails when attempting to migrate the repository to EA3. This posting contains instructions on how to recover from this failure as well as to successful migrate the repository from EA2 to EA3. There are no problems when just installing a fresh Data Miner repository.
    Sorry about the difficulty if this has caused you any problems.
    Mark
    Failure message displayed in log when migrating to EA3:
    Error report -
    ORA-06550: line 96, column 40:
    PLS-00382: expression is of wrong type
    ORA-06550: line 96, column 7:
    PL/SQL: Statement ignored
    06550. 00000 -  "line %s, column %s:\n%s"
    *Cause:    Usually a PL/SQL compilation error.
    *Action:
    Instructions on how to recover from failure and continue using original version of SQL Developer:
    1) Execute the following sql as SYS in order to allow the Data Miner repository to be open for use again:
    UPDATE ODMRSYS.ODMR$REPOSITORY_PROPERTIES
    SET PROPERTY_STR_VALUE = 'LOADED'
    WHERE PROPERTY_NAME = 'REPOSITORY_STATUS';
    COMMIT;
    2) During attempted migrationto EA3 failed, access priviliges to the Data Miner repository are revoked from users. In order to use Data Miner again, these grants must be reapplied. You can either use the UI guided process to accomplish this, which requires the SYS password, or you can run the usergrants.sql script, again as the SYS user. For instructions on how to run the usergrants.sql script, or any adminstrative script, review the instructions contained in the install_scripts_readme.html file. You can find this file in the SQL Developer directories created when you unzipped SQL Developer. It is located in the following relative directory: \<SQL Developer Install Directory>\sqldeveloper\dataminer\scripts.
    Instructions on how to successfully migrate to EA3.
    If you have already attempted to migrate to EA3 and failed, then you need to perform the recovery instructions noted above, after which you can continue with the instructions below.
    If you have not yet attempted to migrate to EA3, then just following the instructions below.
    1) Replace all contents the script file createxmlworkflowsbackup.sql with specification contained at the end of this posting. The file to edit can be found in the \<SQL Developer Install Directory>\sqldeveloper\dataminer\scripts directory.
    2) After completing the edit to createxmlworkflowsbackup.sql,  you can proceed with the UI guided migration or perform the migration using the appropriate migration script. Review the install_scripts_readme.html file in the /dataminer/scripts directory for instructions on how to perform the migration using the script. For the UI migration, simply open any user connection in your Data Miner navigator, and you will be prompted to perform the migration.
    WHENEVER SQLERROR EXIT SQL.SQLCODE;
    DEFINE MAX_VERSIONS = 30
    EXECUTE dbms_output.put_line('Start Backup Data Miner Workflows ' || systimestamp);
    DECLARE
      table_cnt NUMBER;
    BEGIN
      SELECT count(*) INTO table_cnt FROM all_tables WHERE owner='ODMRSYS' AND table_name='ODMR$WORKFLOWS_BACKUP';
      IF (table_cnt = 0) THEN
        EXECUTE IMMEDIATE '
          CREATE TABLE ODMRSYS.ODMR$WORKFLOWS_BACKUP
            USER_NAME VARCHAR2(30 CHAR) NOT NULL
          , PROJECT_ID NUMBER NOT NULL
          , PROJECT_NAME VARCHAR2(30 CHAR) NOT NULL
          , PJ_CREATION_TIME TIMESTAMP(6) NOT NULL
          , PJ_LAST_UPDATED_TIME TIMESTAMP(6)
          , PJ_COMMENTS VARCHAR2(4000 CHAR)
          , WORKFLOW_ID NUMBER NOT NULL
          , WORKFLOW_NAME VARCHAR2(30 CHAR) NOT NULL
          , WORKFLOW_DATA SYS.XMLTYPE
          , CHAIN_NAME VARCHAR2(30 CHAR)
          , RUN_MODE VARCHAR2(30 CHAR)
          , STATUS VARCHAR2(30 CHAR) NOT NULL
          , WF_CREATION_TIME TIMESTAMP(6) NOT NULL
          , WF_LAST_UPDATED_TIME TIMESTAMP(6)
          , BACKUP_TIME TIMESTAMP(6) NOT NULL
          , VERSION NUMBER NOT NULL
          , WF_COMMENTS VARCHAR2(4000 CHAR)
          , CONSTRAINT ODMR$WORKFLOWS_BACKUP_PK PRIMARY KEY
              PROJECT_ID
            , WORKFLOW_ID
            , VERSION
            ENABLE
          LOGGING
          PCTFREE 10
          INITRANS 1
          XMLTYPE COLUMN "WORKFLOW_DATA" STORE AS BASICFILE CLOB';
      END IF;
    END;
    DECLARE
      schema_old_ver VARCHAR2(30);
      schema_ver   VARCHAR2(30);
      patch        VARCHAR2(30);
      db_ver       VARCHAR2(30);
      v_storage    VARCHAR2(30);
      schema_data  CLOB;
      v_db_11_2_0_2 NUMBER; -- db is <= 11.2.0.2?
      row_cnt      NUMBER;
      ver_num      NUMBER := 1;
      maintaindom  NUMBER;
      workflow_rec ODMRSYS.ODMR$WORKFLOWS_BACKUP%ROWTYPE;
    BEGIN
      SELECT STORAGE_TYPE INTO v_storage FROM ALL_XML_TAB_COLS WHERE OWNER='ODMRSYS' AND TABLE_NAME='ODMR$WORKFLOWS' AND COLUMN_NAME='WORKFLOW_DATA';
      if (db is >= 11.2.0.3 AND SQL Dev > 3.0) OR (db is <= 11.2.0.2 AND MAINTAIN_DOM_PATCH_INSTALLED)
        back up all workflows
      end if  
      IF (v_storage != 'BINARY') THEN
        -- determine xml schema version
        SELECT XMLSerialize(CONTENT SCHEMA AS CLOB) INTO schema_data
        FROM DBA_XML_SCHEMAS WHERE schema_url = 'http://xmlns.oracle.com/odmr11/odmr.xsd' AND owner = 'ODMRSYS';
        maintaindom := INSTR(schema_data, 'xdb:maintainDOM="false"', 1, 1);
        -- determine database version
        SELECT version INTO db_ver FROM product_component_version WHERE product LIKE 'Oracle Database%';
        --- Check schema compatibility
        schema_old_ver := '11.2.0.1.9'; -- default value
        BEGIN
          SELECT property_str_value INTO schema_ver
          FROM "ODMRSYS"."ODMR$REPOSITORY_PROPERTIES" WHERE property_name = 'WF_VERSION';
          IF schema_old_ver = schema_ver  THEN
            IF NOT (db_ver = '11.2.0.1' OR db_ver = '11.2.0.2') THEN
              dbms_output.put_line('WARNING: The backup process can not be done, The workflows need to be migrated first');
            RETURN;
            END IF;
          END IF;
        EXCEPTION WHEN NO_DATA_FOUND THEN
          schema_ver  := schema_old_ver;
          dbms_output.put_line('No WF_VERSION found. Defaults to: '  || schema_old_ver);
        END;
        -- determine if MAINTAIN_DOM_PATCH_INSTALLED
        IF (INSTR(db_ver, '11.2.0.2') > 0 OR INSTR(db_ver, '11.2.0.1') > 0 OR INSTR(db_ver, '11.2.0.0') > 0) THEN
          v_db_11_2_0_2 := 1;
          BEGIN
            SELECT PROPERTY_STR_VALUE INTO patch FROM ODMRSYS.ODMR$REPOSITORY_PROPERTIES WHERE PROPERTY_NAME = 'MAINTAIN_DOM_PATCH_INSTALLED';
            patch := UPPER(patch);
          EXCEPTION WHEN NO_DATA_FOUND THEN
            patch := 'FALSE';
          END;
        ELSE
          v_db_11_2_0_2 := 0;
        END IF;
      END IF;
      IF (   v_storage = 'BINARY'
          OR (v_db_11_2_0_2 = 0) -- db is >= 11.2.0.3
          OR ((v_db_11_2_0_2 > 0) AND ((patch = 'TRUE') OR (maintaindom = 0))) ) THEN -- db is <= 11.2.0.2 AND (MAINTAIN_DOM_PATCH_INSTALLED OR maintaindom="true")
        SELECT count(*) INTO row_cnt FROM ODMRSYS.ODMR$WORKFLOWS_BACKUP;
        IF (row_cnt > 0) THEN
          SELECT NVL(MAX(VERSION)+1,1) INTO ver_num FROM ODMRSYS.ODMR$WORKFLOWS_BACKUP;
        END IF;
        FOR wf IN (
          SELECT
            p.USER_NAME "USER_NAME",
            p.PROJECT_ID "PROJECT_ID",
            p.PROJECT_NAME "PROJECT_NAME",
            p.CREATION_TIME "PJ_CREATION_TIME",
            p.LAST_UPDATED_TIME "PJ_LAST_UPDATED_TIME",
            p.COMMENTS "PJ_COMMENTS",
            x.WORKFLOW_ID "WORKFLOW_ID",
            x.WORKFLOW_NAME "WORKFLOW_NAME",
            xmlserialize(DOCUMENT x.WORKFLOW_DATA as CLOB indent size = 2) "WORKFLOW_DATA",
            x.CHAIN_NAME "CHAIN_NAME",
            x.RUN_MODE "RUN_MODE",
            x.STATUS "STATUS",
            x.CREATION_TIME "WF_CREATION_TIME",
            x.LAST_UPDATED_TIME "WF_LAST_UPDATED_TIME",
            x.COMMENTS "WF_COMMENTS"
          FROM ODMRSYS.ODMR$PROJECTS p, ODMRSYS.ODMR$WORKFLOWS x
          WHERE p.PROJECT_ID = x.PROJECT_ID
        LOOP
          workflow_rec.USER_NAME := wf.USER_NAME;
          workflow_rec.PROJECT_ID := wf.PROJECT_ID;
          workflow_rec.PROJECT_NAME := wf.PROJECT_NAME;
          workflow_rec.PJ_CREATION_TIME := wf.PJ_CREATION_TIME;
          workflow_rec.PJ_LAST_UPDATED_TIME := wf.PJ_LAST_UPDATED_TIME;
          workflow_rec.PJ_COMMENTS := wf.PJ_COMMENTS;
          workflow_rec.WORKFLOW_ID := wf.WORKFLOW_ID;
          workflow_rec.WORKFLOW_NAME := wf.WORKFLOW_NAME;
          workflow_rec.WORKFLOW_DATA := SYS.XMLTYPE(wf.WORKFLOW_DATA);
          workflow_rec.CHAIN_NAME := wf.CHAIN_NAME;
          workflow_rec.RUN_MODE := wf.RUN_MODE;
          workflow_rec.STATUS := wf.STATUS;
          workflow_rec.WF_CREATION_TIME := wf.WF_CREATION_TIME;
          workflow_rec.WF_LAST_UPDATED_TIME := wf.WF_LAST_UPDATED_TIME;
          workflow_rec.BACKUP_TIME := SYSTIMESTAMP;
          workflow_rec.VERSION := ver_num;
          workflow_rec.WF_COMMENTS := wf.WF_COMMENTS;
          BEGIN
            -- Output the ids (proj name, workflow name, proj id, workflow id)
            dbms_output.put_line('Backup workflow: ('||wf.PROJECT_NAME||', '||wf.WORKFLOW_NAME||', '||wf.PROJECT_ID||', '||wf.WORKFLOW_ID||')');
            INSERT INTO ODMRSYS.ODMR$WORKFLOWS_BACKUP VALUES workflow_rec;
            COMMIT;
          EXCEPTION WHEN OTHERS THEN
            dbms_output.put_line('Backup workflow failed: ('||wf.PROJECT_NAME||', '||wf.WORKFLOW_NAME||', '||wf.PROJECT_ID||', '||wf.WORKFLOW_ID||')');
          END;
        END LOOP;
      END IF;
      -- keep the latest 30 versions
      EXECUTE IMMEDIATE 'DELETE FROM ODMRSYS.ODMR$WORKFLOWS_BACKUP WHERE VERSION <= :1' USING (ver_num - &MAX_VERSIONS);
      COMMIT;
    EXCEPTION WHEN OTHERS THEN
      ROLLBACK;
      RAISE_APPLICATION_ERROR(-20000, 'Workflow backup failed. Review install log.');
    END;
    EXECUTE dbms_output.put_line('End Backup Data Miner Workflows. ' || systimestamp);

    823006 wrote:
    5.a. XLS export of big number columns looses precision, for example a number(38) column with all digits used.
    I believe excel only holds 15 digits of precision.
    Edited by: 823006 on Jan 18, 2011 8:14 AMThen it would be nice if you can define the "excel type" of each column. So you can make this number a "string" in the XLS.
    Edited by: user9361780 on Jan 18, 2011 9:12 AM

  • Bind variables in SQL Developer

    I declared a bind variable called 'test_num' and assigned a value of 10 as shown below.
    variable test_num number
    BEGIN
    :test_num := 10;
    dbms_output.put_line ('The Test Value: ' || :test_num);
    END;
    When I execute the above program, the output is thrown as 'The Test Value: '. The value of test_num is not shown. I fear whether this issue is due to SQL Developer which i am using to execute this program.
    Please let me know why the value is not getting printed
    Thanks for your help!

    I see the same issue you are seeing when using the bind variable. The bind variable works fine in SQL*Plus but not from SQL Developer.
    From SQLPlus*
    SQL> set serveroutput on
    SQL> variable test_num number
    SQL> BEGIN
    2 :test_num := 10;
    3 dbms_output.put_line ('The Test Value: ' || :test_num);
    4 END;
    5 /
    The Test Value: 10
    PL/SQL procedure successfully completed.
    From SQLDeveloper*
    set serveroutput on
    variable test_num number
    BEGIN
    :test_num := 10;
    dbms_output.put_line ('The Test Value: ' || :test_num);
    END;
    anonymous block completed
    The Test Value:

  • DBMS_OUTPUT.PUT_LINE multi records from PL/SQL procedure to Java web page.

    Hello
    I will explain the scenario:
    In our java web page, we are using three text boxes to enter "Part number,Description and Aircraft type". Every time the user no need to enter all these data. The person can enter any combination of data or only one text box. Actually the output data corresponding to this input entries is from five Oracle table. If we are using a single query to take data from all the five tables, the database will hang. So I written a procedure "SEARCH1",this will accept any combination of values (for empty values we need to pass NULL to this procedure) and output data from all the five tables. When I executing this procedure in SQL editor, the execution is very fast and giving exact result. I used "dbms_output.put_line" clause for outputing multiple records in my procedure. The output variables are "Serial No, part Number, Description, Aircraft type,Part No1,Part No2,Part No3,Part No4". I want to use the same procedure "SEARCH1" for outputing data in java web page.The passing argument I can take from the text box provided in java web page. I am using jdbc thin driver to connect our java web page to Oracle 9i database.
    Note1 : If any combination of search item not available, in procedure itself I am outputing a message like "Part Number not found". Here I am using four words ("Part" is the first word,"Number" is the second,"Not" s the third, and "found" is the fourth) for outputing this message.Is it necessary to equalise number of words I am using here to the record outputing eight variable?
    Our current development work is stopped because of this issue. So any one familier in this field,plese help me to solve our issue by giving the sample code for the same scenario.
    My Email-id is : [email protected]
    I will expect yor early mail.
    With thanks
    Pramod kumar.

    Hello Avi,
    I am trying to solve this issue by using objects. But the following part of code also throwing some warning like "PLS-00302: component must be declared". Plese cross check my code and help me to solve this issue.
    drop type rectab;
    create or replace type rectype as object(PartNo varchar2(30),Description varchar2(150),AIrcraft_type varchar2(15),status_IPC varchar2(30),status_ELOG varchar2(30),status_SUPCAT varchar2(30),status_AIRODWH varchar2(30));
    create or replace type rectab as table of rectype;
    create or replace package ioStructArray as
    procedure testsch2(pno in varchar2,pdes in varchar2,air in varchar2,orec in out rectab);
    end ioStructArray;
    create or replace package body ioStructArray as
    procedure testsch2(pno in varchar2,pdes in varchar2,air in varchar2,orec in out rectab) is
    mdescription varchar2(150);
    mpartnum varchar2(30);
    mpno varchar2(30);
    mdes varchar2(150);
    mair varchar2(15);
    mstat varchar2(1);
    cursor c1 is select partnum,description,aircraft_type from master_catalog where partnum=mpno and aircraft_type=mair and description like ltrim(rtrim(mdes))||'%';
    cursor c2 is select partnum from ipc_master where partnum=mpartnum;
    cursor c3 is select partnum from fedlog_data where partnum=mpartnum;
    cursor c4 is select partnum from superparts where partnum=mpartnum;
    cursor c5 is select part_no from supplier_catalog where part_no=mpartnum;
    mpno1 varchar2(30);
    mpno2 varchar2(30);
    mpno3 varchar2(30);
    mpno4 varchar2(30);
    mpno5 varchar2(30);
    maircraft_type varchar2(15);
    mstat1 varchar2(30);
    mstat2 varchar2(30);
    mstat3 varchar2(30);
    mstat4 varchar2(30);
    begin
    mstat:='N';
    mpno:=pno;
    mdes:=pdes;
    mair:=air;
    if mpno is not null and mdes is not null and mair is not null then
    begin
    mstat:='N';
    mpno:=pno;
    mdes:=pdes;
    mair:=air;
    for i in c1 loop
    mstat:='N';
    mstat1:='N';
    mstat2:='N';
    mstat3:='N';
    mstat4:='N';
    mpno1:=i.partnum;
    mpartnum:=i.partnum;
    mdescription:=i.description;
    maircraft_type:=i.aircraft_type;
    for j in c2 loop
    mpno2:=j.partnum;
    end loop;
    for k in c3 loop
    mpno3:=k.partnum;
    end loop;
    for l in c4 loop
    mpno4:=l.partnum;
    end loop;
    for m in c5 loop
    mpno5:=m.part_no;
    end loop;
    if mpno2=mpartnum then
    mstat1:=mpno2;
    end if;
    if mpno3=mpartnum then
    mstat2:=mpno3;
    end if;
    if mpno4=mpartnum then
    mstat3:=mpno4;
    end if;
    if mpno5=mpartnum then
    mstat4:=mpno5;
    end if;
    if mpno1=mpartnum then
    mstat:='Y';
    orec.PartNo:=mpno1;
    orec.Description:=mdescription;
    orec.AIrcraft_type:=maircraft_type;
    orec.status_IPC:=mstat1;
    orec.status_ELOG:=mstat2;
    orec.status_SUPCAT:=mstat3;
    orec.STATUS_AIRODWH:=status_AIRODWH;
    end if;
    end loop;
    end;
    end if;
    end testsch2;
    end ioStructArray;
    Expecting your early reply.
    With thanks
    Pramod kumar.

  • How to see dbms_output on oracle sql developer

    ned immediate help
    how to see dbms_output on oracle sql developer

    Hi,
    In sql developer u have a tab named DBMS Output in your result sheet. In that the first Icon is Enable DBMS Output. turn it on (After on it will give the message set serveroutput on in the sheet) and then run your code.
    In the code u have to use the dbms_output.put_line package.after running the code u have to see the result in DBMS Output tab.
    Regards,
    NTR

  • Oracle 10.1.0.4.2 SQL Plus dbms_output.put_line not working

    I am using Oracle 10.1.0.4.2 SQL Plus, and dbms_output.put_line is not working. It returns the dbms_output ONLY from outside the procedure. I have dbms_output INSIDE my procedure, and none of it gets returned. Please help!
    Here is what I enter:
    set serveroutput on size 1000000;
    DECLARE
         x number:=0;
    begin
    DBMS_OUTPUT.ENABLE;
    c2reports.c2proc(x,'TEST');
    DBMS_OUTPUT.PUT_LINE('testX');
    END;
    testX
    There should be more besides the 'testX' that gets returned. The first line in my procedure has output code to print testY. Thanks in advance!

    This is the forum for the Oracle's SQL Developer (Not for general SQL/PLSQL questions). You should ask question like this in the PL/SQL forum

  • Sql developer - dbms_output problem

    Hi
    I am not getting any output using sql developer.
    set serveroutput on;
    begin
    dbms_ouput.enable(10000);
    dbms_output.put_line('abc');
    end;
    anonymous block completedI saw some threads ..with same problems. but I am not understanding where is that dbms_output tab in my sql developer ?
    Tried alot .. but no use.
    Please advise....!!!
    Regards
    Rekha

    In your SQL Developer (usually at the bottom) there should be a tab "Dbms Output".
    If there is not, then you probably have closed that tab at some point by accident - then you can get it back by going in the View menu and clicking Dbms Output.
    In that tab is a green plus sign - if you hover over it you will see the tool tip "Enable DBMS OUTPUT for connection".
    Clicking that green plus sign is similar to doing "set serveroutput on" in SQL*PLUS.
    When I try it, somehow it only seems to work if I run my script using F5 rather than F9?
    I think a good place to get further answers is in the SQL Developer forum - some of the people who write SQL Developer are helping out there ;-)

  • Where has DBMS_Output gone in SQL Developer 3

    Hi,
    I have recently installed SQL Developer 3.0.04 Build MAIN-04.34
    In previous versions I have been used to finding a tab that is titled "DBMS Output" along side Script Output, Autotrace etc.
    Could someone tell me how to make the DBMS Output tab active in SQL Developer 3?
    Thank You
    Benton
    Edited by: Benton on Aug 9, 2011 3:42 PM

    OK then ;) ... as you aren't a novice user I wasn't sure if you tried that already.
    Have fun,
    K.

  • Oracle sql developer and  oracle express

    I am new in PL/SQL
    I just wonder for run the pl/sql , why has the different result for two tools
    for the following example I get out put on the express
    Employee 145 commission .4 which is High
    Statement processed.
    on sql developer I get
    anonymous block completed why???
    DECLARE
      n_pct employees.commission_pct%TYPE;
      v_eval VARCHAR2(10);
      n_emp_id employees.employee_id%TYPE := 145;
    BEGIN
      -- get commission percentage
      SELECT commission_pct
      INTO n_pct
      FROM employees
      WHERE employee_id = n_emp_id;
      -- evalutate commission percentage
      CASE n_pct
      WHEN 0 THEN
        v_eval := 'N/A';
      WHEN 0.1 THEN
        v_eval := 'Low';
      WHEN 0.4 THEN
        v_eval := 'High';
      ELSE
        v_eval := 'Fair';
      END CASE;
      -- print commission evaluation
      DBMS_OUTPUT.PUT_LINE('Employee ' || n_emp_id || ' commission ' || TO_CHAR(n_pct) || ' which is ' || v_eval);
    END;
    /

    Hjava wrote:
    I just wonder for run the pl/sql , why has the different result for two tools
    for the following example I get out put on the express
    Employee 145 commission .4 which is High
    Statement processed.
    on sql developer I get
    anonymous block completed why???Nothing to do with the database or PL/SQL.
    The client makes the call (e.g. passing the PL/SQL anon block to the server to be parsed and executed).
    This is successful. The server returns a zero return code to that client call. This means successful completion of that database call.
    The client can now choose to display any message it wants to inform the user of that - from "+hey dude, it worked!+" to "+command completed successfully+" or whatever.
    The database does not return a message string in response to that call - only a return code. What the client can do is make another call and request the associated message from the client driver for that return code. In this case, an English language message file (as queried by the driver) will return the message string, "+normal, successful completion+".

  • Function will not run (and shows with red cross in SQL Developer)

    I have created the function below by typing into the "Enter SQL Statement" box in the SQL Developer tool and running. I see the message "create or REPLACE FUNCTION Statement Processed". I see the Function in the tree view, but it has a red cross icon next to it, so I guess somethings wrong with it. When I try to run it I get the message "The selected program is in an invalid state for running. Recompile the program and try again." If I right-click the function and compile then I get no errors but the red cross remains and I still can't run it.
    What am I doing wrong?
    Also, I am planning on supplying a SQL script to customers that will have this function at the top of the script, and then I will use the function throughout the rest of the script to decide whether or not to drop a table before re-creating it. Will that be ok? i.e. will the function be available to the rest of the script, or would the function creation need to be followed by a commit/grant/other?
    CREATE OR REPLACE FUNCTION CHECK_TABLE_EXISTS(tableName VARCHAR2)
    RETURN BOOLEAN IS
        tableExists NUMBER(1,0);
    BEGIN
          SELECT COUNT(*) INTO tableExists FROM user_tables WHERE table_name=tableName;
          IF tableExists = 1 THEN
            RETURN TRUE;
          ELSE
            RETURN FALSE;
          END IF;
    END CHECK_TABLE_EXISTS;Thanks,
    Paul

    Hello Try the same at sqlplus and see how it goes. It should not throw any error messages as I tried the same as a normal user Scott with only (connect, resource) priveleges. You dont have to grant any specific previleges for user_tables.
    -Sri
    SRI>conn scott/tiger@sri
    Connected.
    SRI>CREATE OR REPLACE FUNCTION CHECK_TABLE_EXISTS(tableName VARCHAR2)
      2  RETURN BOOLEAN IS
      3      tableExists NUMBER(1,0);
      4  BEGIN
      5        SELECT COUNT(*) INTO tableExists FROM user_tables WHERE table_name=tableName;
      6        IF tableExists = 1 THEN
      7          RETURN TRUE;
      8        ELSE
      9          RETURN FALSE;
    10        END IF;
    11  END CHECK_TABLE_EXISTS;
    12  /
    Function created.
    SRI>set serverout on
    SRI>begin
      2  if check_table_exists('EMP') = TRUE
      3  THEN
      4  dbms_output.put_line('Found');
      5  else
      6  dbms_output.put_line('Not Found');
      7  end if;
      8  end;
      9  /
    Found
    PL/SQL procedure successfully completed.

  • How to get server output in SQL Developer

    I am learning SQL Deverloper and am using it in a University environment as well as Oracle test instances at Oracle.
    I know my way around SQL some but I am just learning PL/SQL.  I want to run an anonymous block and see output for the "dbms_output.put_line" items.
    At school, I enter my block in the "SQL Worksheet" and receive the "anonymous block completed" in the "Script Output" screen.  Then there is a 3rd screen, the name of which I cannot remember, but I believe it is the equivalent of "server output".  When I open it I have to tell it which database I'm using.  Then, I see the dbms output lines in this 3rd section.
    The problem is when I am using SQL Developer at work, I see only 2 sections:  "SQL Worksheet" and "Script Output".
    I have looked but cannot find an option or a button or a window that is called something like "server output" or "view server output."
    Can a more experienced user please help me?
    I am using:
    SQL Developer Version 3.1.07
            Build MAIN-07.42
    Linux x86-64
    (Oracle Internal:
    Instance: http://celalnx38.us.oracle.com:10507/
    tnsnames: 10500)

    Hi Makel,
    There are no changes of which I am aware in the Dbms_Output view functionality between the 3.2 and 4.0 releases.
    As to your point about confusion, keep in mind the following:
    1. Each Worksheet tab and Dbms_Output tab include the name of the connection in use.  Match on that name when checking output results.
    2. Opening multiple Worksheets on the same connection name will share one database connection by default.
    3. Multiple Worksheets sharing a database connection also share one Dbms_Output tab.  That is by design.
    To force worksheets to use unshared connections:
    4. Change the default behavior of (2) via Tools -> Preferences -> Database -> Worksheet -> New Worksheet to use unshared connection.
    5. Or avoid (4's) overhead of always using unshared connections by opening one-off unshared Worksheets: Ctrl + Shift + N from a shared Worksheet.
    Finally:
    6. When using unshared Worksheets, one Dbms_Output tab may be opened per unshared Worksheet.  Note that the names of any unshared Worksheets will appear in Dbms_Output's Select Connection dialog drop down list. That should avoid any confusion.
    Hope this helps,
    Gary

  • Executing procedure with IN OUT parameters using SQL developer

    Hi, I'm trying to exceute the below procedure in SQL developer. Here the IN OUT cursor 'journal_cursor' is already defined.
    PROCEDURE LIST_FORPROJECT (
              p_project_sid IN NUMBER,
              p_journal_cursor IN OUT journal_cursor,
         AS
         BEGIN
              OPEN p_journal_cursor FOR
              -- get the journal
                   SELECT j.JOURNAL_KEY AS "Journal_SID",
                             j.JOURNALTEXT AS "Entry",
                             j.CREATEDATE AS "CreateDate",
                             --j.COMMENT_ AS "Comment",
                             j.PROJECTPHASETASK_KEY AS "ProjectPhaseTaskSet_SID",
                             j.person_key AS "Person_SID"
    FROM vdl_JOURNAL j
                   INNER JOIN vdl_PROJECTJOURNAL pj ON pj.JOURNAL_KEY = j.JOURNAL_KEY
                   WHERE pj.PROJECT_KEY = p_project_sid
                   ORDER BY j.CREATEDATE ASC, j.JOURNAL_KEY ASC;
    END LIST_FORPROJECT;
    When trying to run the above procedure through SQL developer, I get the below code generated.
    DECLARE
    P_PROJECT_SID NUMBER;
    P_JOURNAL_CURSOR journal_cursor;
    BEGIN
    P_PROJECT_SID := 5974;
    -- Modify the code to initialize the variable
    -- P_JOURNAL_CURSOR := NULL;
    -- Modify the code to initialize the variable
    LIST_FORPROJECT(
    P_PROJECT_SID => P_PROJECT_SID,
    P_JOURNAL_CURSOR => P_JOURNAL_CURSOR,
    -- Modify the code to output the variable
    DBMS_OUTPUT.PUT_LINE('P_JOURNAL_CURSOR' || P_JOURNAL_CURSOR);
    END;
    But executing the above sql doesn't print the cursor as output but errors out saying 'wrong number or type or arguments in call to ||'. Can somebody please help me in finding a way test and view the results of such a procedure through SQL developer?
    Any help is highly appreciated.
    Regards,
    Ranganath

    Hi,
    I was able to solve the problem.. My cursor was declared like this.
    TYPE journal_def IS RECORD
              journal_sid                    NUMBER(10),
              journaltext                    CLOB,
              createdate                    DATE,
              projectphasetaskset_sid     NUMBER(10),
              person_sid                    NUMBER(10)
    TYPE journal_cursor                    IS REF CURSOR RETURN journal_def;
    I used the journal_def type to fetch the records.
    Here is how my final sql looked like.
    DECLARE
    P_PROJECT_SID NUMBER;
    P_JOURNAL_CURSOR journal_cursor;
    P_J_CURSOR journal_def;
    BEGIN
    P_PROJECT_SID := 11171;
    -- Modify the code to initialize the variable
    -- P_JOURNAL_CURSOR := NULL;
    LIST_FORPROJECT(
    P_PROJECT_SID => P_PROJECT_SID,
    P_JOURNAL_CURSOR => P_JOURNAL_CURSOR,
    -- Modify the code to output the variable
    BEGIN
    --open P_JOURNAL_CURSOR;
    loop
    fetch P_JOURNAL_CURSOR into P_J_CURSOR;
    exit when P_JOURNAL_CURSOR%NOTFOUND;
    DBMS_OUTPUT.put_line(P_J_CURSOR.journal_sid);
    end loop;
    --close P_JOURNAL_CURSOR;
    END;
    END;
    This gave me results. Thanks a ton ALL for your help..... :)..
    Regards,
    Ranganath

  • Procedure output like a query in SQL developer?

    Hi!
    How can a PL procedure create output like a query in SQL developer?
    This block
    begin
    for record in (
    select * from my_db
    loop
    dbms_output.put_line(record.name ' ' || record.address)
    end loop;
    end;
    would print a of names and adresses in my_db. However, output sent to a query result window which would be the result of
    select name,address from my_db;
    How could I make the PL block behave the same way as the SQL query, i.e. present its output in a query result window?

    Welcome to the forum!
    Please provide your 4 digit Oracle version (result of SELECT * FROM V$VERSION) wheneve you ask a question.
    Do you mean query a procedure as if it were a table?
    You can do that with a pipelined function. Here is sample code you can test using the SCOTT schema
    -- type to match emp record
    create or replace type emp_scalar_type as object
      (EMPNO NUMBER(4) ,
       ENAME VARCHAR2(10),
       JOB VARCHAR2(9),
       MGR NUMBER(4),
       HIREDATE DATE,
       SAL NUMBER(7, 2),
       COMM NUMBER(7, 2),
       DEPTNO NUMBER(2)
    -- table of emp records
    create or replace type emp_table_type as table of emp_scalar_type
    -- pipelined function
    create or replace function get_emp( p_deptno in number )
      return emp_table_type
      PIPELINED
      as
       TYPE EmpCurTyp IS REF CURSOR RETURN emp%ROWTYPE;
        emp_cv EmpCurTyp;
        l_rec  emp%rowtype;
      begin
        open emp_cv for select * from emp where deptno = p_deptno;
        loop
          fetch emp_cv into l_rec;
          exit when (emp_cv%notfound);
          pipe row( emp_scalar_type( l_rec.empno, LOWER(l_rec.ename),
              l_rec.job, l_rec.mgr, l_rec.hiredate, l_rec.sal, l_rec.comm, l_rec.deptno ) );
        end loop;
        return;
      end;
      /Then you can query the function as if it were a table
    select * from table(get_emp(20))Is that what you were looking for?

  • 30EA2 dbms_output.put_line not working

    Hi All,
    I've testing new release SQL Developer and
    the code bellow is not put any data to output? Is it an issue new version ?
    BEGIN
    dbms_output.put_line('[text]');
    END;
    SQL Developer
    Version 3.0.02
    Build MAIN-02.83
    Thank you in advance
    Edvard

    Hi Edvard,
    Yes, dbms_output is borked on 3.0EA2, but you can make it work if you put 'SET SERVEROUTPUT ON' in front of your statement:
    SET SERVEROUTPUT ON
    BEGIN
    dbms_output.put_line('[text]');
    END;
    And run it as a script (F5 on Windows, I think)
    See EA2: Dbms Output broken? for more.

Maybe you are looking for