My first PL/SQL script does not work
DBAsupport.com Forums - Powered by vBulletin
Results 1 to 5 of 5

Thread: My first PL/SQL script does not work

  1. #1
    Join Date
    Nov 2000
    Posts
    42

    Unhappy

    Hello.

    I'm trying to execute my first PL/SQL script on Oracle 8i:

    sqlplus system/manager @myscrypt.sql

    myscript.sql:
    -----------
    declare
    my_age NUMBER;
    begin
    select AGE into my_age from PUPILS where name='John';
    dbms_output.put_line('AGE: ' || my_age);
    end;
    ----------

    But I get this:

    Connected to:
    Oracle8i Enterprise Edition Release 8.1.7.0.0 - Production
    JServer Release 8.1.7.0.0 - Production
    12

    And the cursos blinks just after '12', but nothing happens.

    What am I doing wrong?

    Thank you very much.

    ========
    LARRY ELLISON

  2. #2
    Join Date
    Jun 2001
    Location
    Helsinki. Finland
    Posts
    3,938
    At the end of the script, add one more line which contains only one symbol:

    Code:
    /
    How about now :-)
    Oracle Certified Master
    Oracle Certified Professional 6i,8i,9i,10g,11g
    email: ocp_9i@yahoo.com

  3. #3
    Join Date
    Nov 2000
    Posts
    42

    Unhappy Does not work

    Thank you, Julian, for your answer.

    I changed my script:

    ....
    end;
    /

    But it still does not work. The cursor blinks after '12'.
    ========
    LARRY ELLISON

  4. #4
    Join Date
    Nov 2000
    Posts
    42

    Talking It works

    I'm sorry.

    I forgot to save my script. Now it works, but it does not print anything.

    Is 'put_line' command the right one?

    Thank you very much.
    ========
    LARRY ELLISON

  5. #5
    Join Date
    Jun 2001
    Location
    Helsinki. Finland
    Posts
    3,938

    Re: It works

    Originally posted by l-ellison
    I'm sorry.

    I forgot to save my script. Now it works, but it does not print anything.

    Is 'put_line' command the right one?

    Thank you very much.
    Before declare add a new/first line

    Code:
    set serveroutput on
    Oracle Certified Master
    Oracle Certified Professional 6i,8i,9i,10g,11g
    email: ocp_9i@yahoo.com

Posting Permissions

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



Click Here to Expand Forum to Full Width