Results 1 to 12 of 12
  1. #1
    Join Date
    Jan 2004
    Posts
    15

    Unanswered: simple trigger ...could any one help me with that ?

    hi ...
    i am new to oracle and PL/SQL ...

    i have a problem in a form ...its a non database form which i created using developer 6i ...i have wrote the codes but its not running ... i am not really sure about the codes although its VERY SIMPLE ...

    this is the code

    begin
    if : pay.hours_worked<40 then
    : pay.gross=Houres_worked*hourly_rate;
    end if;

    if : pay.hours_worked>=40 then
    : pay.gross=Houres_worked (hourly_rate*1.5);
    end if;

    if : pay.radio='member' then
    : pay.fee= -20;
    end if;

    if : pay.radio='non' then
    : pay.fee= 0;
    end if;

    if : pay.list='ohio' then
    : pay.bonus=50;
    else
    : pay.bonus=100;
    end if;

    : pay.net=: pay.gross+: pay.fee+: pay.bonus;

    end;

    i am sure that the codes for the radio buttons and the list is wrong ... also i dont know what to chenge in the properties of the tools ...i only change that database items into No ...

    please could anyone help me with this and tell me what is wrong ...

    i have attached the form i created

  2. #2
    Join Date
    Sep 2002
    Location
    UK
    Posts
    5,171
    Provided Answers: 1

    Re: simple trigger ...could any one help me with that ?

    1) All those spaces between the :'s and block names are wrong, e.g.:

    if : pay.hours_worked<40 then

    should be:

    if :pay.hours_worked<40 then

    2) The assignment operator in PL/SQL is ":=" not "=":

    :pay.gross := Houres_worked*hourly_rate;

  3. #3
    Join Date
    Jan 2004
    Posts
    15
    hi andrewst
    thanx for ur fast replay ...

    i corrected them but still the form not working ...what else could be wrong ???

  4. #4
    Join Date
    Jul 2003
    Posts
    2,296
    post your whole trigger code and the full errors you are getting.
    - The_Duck
    you can lead someone to something but they will never learn anything ...

  5. #5
    Join Date
    Jan 2004
    Posts
    15
    hi The_Duck


    i attached the form ...please find it
    Attached Files Attached Files

  6. #6
    Join Date
    Jul 2003
    Posts
    2,296
    I have no idea what a .fmb file is.

    Can you please post the create-trigger code in text format and then the error oracle then shows when you try to create the trigger?
    - The_Duck
    you can lead someone to something but they will never learn anything ...

  7. #7
    Join Date
    Jan 2004
    Posts
    15
    this is the errors i got ...
    http://e7m.jeeran.com/error.bmp


    and here is the code

    begin
    if : pay.hours_worked<40 then
    : pay.gross:=Houres_worked*hourly_rate;
    end if;

    if : pay.hours_worked>=40 then
    : pay.gross:=Houres_worked*(hourly_rate*1.5);
    end if;

    if : pay.radio='member' then
    : pay.fee:= -20;
    end if;

    if : pay.radio='non' then
    : pay.fee:= 0;
    end if;

    if : pay.list='ohio' then
    : pay.bonus:=50;
    else
    : pay.bonus:=100;
    end if;

    : pay.net:=: pay.gross+: pay.fee+: pay.bonus;

    end;

  8. #8
    Join Date
    Sep 2002
    Location
    UK
    Posts
    5,171
    Provided Answers: 1
    I refer you back to point (1) in my earlier post ;o)

    ":block.item" NOT ": block.item"

  9. #9
    Join Date
    Jan 2004
    Posts
    15
    dear andrewst ...

    i wrote it in the form as ":block.item" ..
    but when i publish it here it will display the loling face as the code start with : P

    look at this
    if ay.hours_worked<40 then
    ay.gross:=Houres_worked*hourly_rate;
    end if;


    thats y i put spaces ...

  10. #10
    Join Date
    Jul 2003
    Posts
    2,296
    you need to pass in your parameters.
    looks like you want to use 'HOURS_WORKED' and 'HOURLY_RATE' but you don't pass them in anywhere that I can see.


    also, this doesn't look like a trigger.
    just looks like a procedure.
    - The_Duck
    you can lead someone to something but they will never learn anything ...

  11. #11
    Join Date
    Jan 2004
    Posts
    15
    hi ... i was able to run the form with out errors finaly ... but still there is some missing things like ...the list is with out data ... and i dont know how to add data to it ...

    please find attachment the form ...
    Attached Files Attached Files

  12. #12
    Join Date
    Jun 2004
    Posts
    4

    fixed files

    I don't know, is your question actual yet, but I send you fixed files
    Attached Files Attached Files

Posting Permissions

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