Results 1 to 6 of 6
  1. #1
    Join Date
    Nov 2007
    Posts
    29

    Unhappy Unanswered: sql plus from sql developer

    Hi
    Can someone help me as regards my sql developer version 1.2.1
    I am using an oracle 10g running on a linux server. i execute plsql procedures from the worksheet that came with the sql developer but i can't see any result on screen but it says pl sql procedure exceuted. i have set the parameter setting serveroutput to on and yet no result. what do i do?
    'soga

  2. #2
    Join Date
    Jan 2004
    Location
    Croatia, Europe
    Posts
    4,094
    Provided Answers: 4
    Could we see a simplified example of the script you use?

    A blind guess: did you use DBMS_OUTPUT package?

  3. #3
    Join Date
    Nov 2007
    Posts
    29

    sql plus from sql developer

    Below is the test query i ran. i am starting to learn plsql so i tried this query out. thanks
    DECLARE
    2 "pi" CONSTANT NUMBER := 3.141592654;
    3 "PI" CONSTANT NUMBER := 3.14159265358979323846;
    4 "2 pi" CONSTANT NUMBER := 2 * "pi";
    5 BEGIN
    6 DBMS_OUTPUT.PUT_LINE('pi: ' || "pi");
    7 DBMS_OUTPUT.PUT_LINE('PI: ' || pi);
    8 DBMS_OUTPUT.PUT_LINE('2 pi: ' || "2 pi");
    9* END;

  4. #4
    Join Date
    Jan 2004
    Location
    Croatia, Europe
    Posts
    4,094
    Provided Answers: 4
    I did the same using SQL Developer 1.2.1, and got the output (see the attachment). I've marked three buttons I used - executed it as a script (F5 is the shortcut key), enabled DBMS_OUTPUT and viewed the DBMS_OUTPUT tab.

    Click image for larger version. 

Name:	sqld_output.PNG 
Views:	1183 
Size:	19.7 KB 
ID:	7832

    I guess you "forgot" to switch to the DBMS_OUTPUT tab. Did you?

    P.S. Oh, I forgot to mention - I hope you are NOT going to name variables using quotation marks. You do know that you'll have to reference them using those marks every time you plan to use them in your code?

    I'd suggest you not to use such a notation.

  5. #5
    Join Date
    Nov 2007
    Posts
    29

    Thumbs down plsql code from sql developer

    Oops!
    Thanks a lot.
    I did not enable the DBMS Output. Its working well now
    With regards to the code, I am not using the code as i am familiar tha the variable name declaration is illegal in oracle. i just used it to test the output of the plsql result within sql developer
    'soga

  6. #6
    Join Date
    Jan 2004
    Location
    Croatia, Europe
    Posts
    4,094
    Provided Answers: 4
    No, such a declaration is not illegal (obviously; otherwise, your code wouldn't work at all), but - look what it can do: create a table and be "unable" to access it without double quotes:
    Code:
    SQL> create table "test" (id number, name varchar2(20));
    
    Table created.
    
    SQL> insert into test (id, name) values (1, 'Littlefoot');
    insert into test (id, name) values (1, 'Littlefoot')
                *
    ERROR at line 1:
    ORA-00942: table or view does not exist
    
    
    SQL> insert into "test" (id, name) values (1, 'Littlefoot');
    
    1 row created.
    
    SQL> select * from test;
    select * from test
                  *
    ERROR at line 1:
    ORA-00942: table or view does not exist
    Now let's create another table and perform a simple join to see where I live:
    Code:
    SQL> create table test_2 (id number, location varchar2(20));
    
    Table created.
    
    SQL> insert into test_2 (id, location) values (1, 'Croatia');
    
    1 row created.
    
    SQL> select t.id, t.name, t2.location
      2  from test t, test_2 t2
      3  where t.id = t2.id;
    from test t, test_2 t2
         *
    ERROR at line 2:
    ORA-00942: table or view does not exist
    
    
    SQL> select t.id, t.name, t2.location
      2  from "test" t, test_2 t2
      3  where t.id = t2.id;
    
            ID NAME                 LOCATION
    ---------- -------------------- --------------------
             1 Littlefoot           Croatia
    
    SQL>
    Not very convenient, that double-quotes-naming principle, is it? Not that it is impossible (or "illegal", as you've put it), but - it is a real pain.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •