Results 1 to 3 of 3
  1. #1
    Join Date
    Oct 2003
    Location
    Brazil
    Posts
    30

    Unanswered: Executing a procecedure

    Probably this is the most stupid question in the entire database =)

    Well, I'm out of time and I'm absolutely new to PL/SQL, so, if u could help...


    I have a specific procedure to execute

    This can be performed simply by pasting its body into my TOAD session and pressing CTRL + ENTER (asking for TOAD to execute the script) ?


    I mean:

    Declare
    ...
    ...
    BEGIN
    ...
    ...
    ...
    END


    This is the body of the procedure.
    Can I execute it just as a normal script ?

    Thanks anyway.

  2. #2
    Join Date
    Jun 2004
    Location
    Liverpool, NY USA
    Posts
    2,509
    Here is an example

    Login into sql*plus and type the following

    declare
    cnt number;
    begin
    select count(*)
    into cnt
    from dual;
    end;
    / <------- This is what starts up the procedure.




    If you have typed a procedure into a file, you can start it by typing in sql*plus

    @my_file.sql
    /

    if You include the "/" in the seperate file (at the end), it will run as soon as you type the @my_file.sql
    Last edited by beilstwh; 11-26-04 at 16:55.
    Bill
    You do not need a parachute to skydive. You only need a parachute to skydive twice.

  3. #3
    Join Date
    Nov 2002
    Location
    Desk, slightly south of keyboard
    Posts
    697
    If you have a procedure called fred (create or replace procedure fred...), in TOAD, use the following within the SQL editor.

    begin
    fred;
    end;

    or change fred for fred( parm1,... ) or package.procedure() etc etc.

    Use CTRL+ENTER as you currently do.

    Hth
    Bill
    Please don't email me directly with questions. I've probably just got home from the pub and cannot guarantee the sanity of my answers. In fact, I can't believe I actually made it home.

Posting Permissions

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