Results 1 to 6 of 6
  1. #1
    Join Date
    Mar 2010
    Posts
    2

    Unhappy Unanswered: help me please in this procedure

    hi i want execute a procedure in oracle 10g

    i have a table named "empleados"

    I created the procedure

    the procedure a 20% increase the salary to employees who earn less than average

    create or replace procedure pa_aumentarsueldo
    as
    begin

    update empleados
    set sueldo=sueldo+(sueldo*0.2)
    where sueldo<(select avg(sueldo) from empleados);

    end;


    The procedure creates no problem, But when I try to run the procedure

    execute pa_aumentarsueldo;

    ORA-00900 invalid sql statement

    I use toad for oracle and pl/sql developer 8

    I take the web site http://www.oracleya.com.ar/problemas...d=252&punto=94

  2. #2
    Join Date
    Jul 2003
    Posts
    2,296
    post the whole sql code and results.
    ie: create the procedure in sqlplus,
    execute the proc
    get the error

    post all of that from sqlplus.
    your error doesn't even say what line the error is on.
    Last edited by The_Duck; 03-09-10 at 16:52.
    - The_Duck
    you can lead someone to something but they will never learn anything ...

  3. #3
    Join Date
    Mar 2010
    Posts
    2
    thanks man in sqlplus run .... but why in toad or pl/sql developer don't run

  4. #4
    Join Date
    Jul 2003
    Posts
    2,296
    my first question would be:
    What version of TOAD and oracle client are you running and is it compatible with the version of 10g you are running.

    GUIs can be pretty finicky.
    - The_Duck
    you can lead someone to something but they will never learn anything ...

  5. #5
    Join Date
    Jun 2004
    Location
    Liverpool, NY USA
    Posts
    2,509
    A cleaner way to write the update would be\

    update empleados
    set sueldo=sueldo*1.2
    where sueldo<(select avg(sueldo) from empleados);
    Bill
    You do not need a parachute to skydive. You only need a parachute to skydive twice.

  6. #6
    Join Date
    Jan 2004
    Location
    Croatia, Europe
    Posts
    4,094
    Provided Answers: 4
    Did you, perhaps, execute a single SQL statement? Try to push the "Execute as script" button instead.

Tags for this Thread

Posting Permissions

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