Results 1 to 5 of 5
  1. #1
    Join Date
    May 2011
    Posts
    3

    Unanswered: trigger for automatic increment of data

    can any one plz help me out of this problem.I need to create a trigger to modify the data (in oracle 10g) by comparing the date of join of employee and the system date.if they are equal the data should be modified.

  2. #2
    Join Date
    Mar 2007
    Posts
    623
    Quote Originally Posted by ESHA View Post
    can any one plz help me out of this problem.I need to create a trigger to modify the data (in oracle 10g) by comparing the date of join of employee and the system date.if they are equal the data should be modified.
    What is your exact problem with implementing this? Creating a trigger is described in Oracle documentation books, available e.g. online on http://tahiti.oracle.com/ (SQL Reference shows command syntax, PL/SQL User's Guide and Reference describes PL/SQL language specification).

    I am not sure what is your requirement, as "create trigger" sounds like implementation specification. Is this some kind of homework assignment? Anyway, be aware, that trigger fires on SQL command execution (e.g. INSERT or UPDATE statement); when no SQL is issued, the trigger is not run at all. But, without the exact specification what and when (not how) should be achieved, it is hard to tell.

  3. #3
    Join Date
    Aug 2003
    Location
    Where the Surf Meets the Turf @Del Mar, CA
    Posts
    7,776
    Provided Answers: 1
    when all else fails Read The Fine Manual

    Overview of PL/SQL
    You can lead some folks to knowledge, but you can not make them think.
    The average person thinks he's above average!
    For most folks, they don't know, what they don't know.
    Good judgement comes from experience. Experience comes from bad judgement.

  4. #4
    Join Date
    May 2011
    Posts
    3

    Question trigger for automatic increment of data

    i am doing employee payroll system using java swings and my back end is oracle 10g.the increment money given to the employee should be increased every year from his join date in the database automatically.
    Ex: if the present increment is 275 and his join date is 02-jan-2000 then on 02-jan-2001 his increment should be added by 275(it sholud be doubled).
    do i need to use trigger to increment?

  5. #5
    Join Date
    Aug 2003
    Location
    Where the Surf Meets the Turf @Del Mar, CA
    Posts
    7,776
    Provided Answers: 1
    >do i need to use trigger to increment?
    TRIGGER is based upon some DML occurring.
    so specify who, how & when DML occurs to fire your trigger?

    consider using batch job instead
    Last edited by anacedent; 05-15-11 at 12:04. Reason: typo
    You can lead some folks to knowledge, but you can not make them think.
    The average person thinks he's above average!
    For most folks, they don't know, what they don't know.
    Good judgement comes from experience. Experience comes from bad judgement.

Posting Permissions

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