Results 1 to 3 of 3
  1. #1
    Join Date
    May 2007
    Posts
    10

    Unhappy Unanswered: Writing insert and update triggers on ASE 15.0

    I have some problems writing insert and update triggers on Sybase ASE 15 here is my code
    Insert trigger
    CREATE TRIGGER dbo.ins_MAIL_BOX ON dbo.MAIL_BOX
    For INSERT AS
    BEGIN
    select created_by=user,
    creation_date=getdate(),
    updated_by=user,
    updated_date=getdate()
    from MAIL_BOX
    END

    Update trigger

    Create Trigger dbo.upd_MAIL_BOX On MAIL_BOX for update As Begin

    select updated_date=getdate(),updated_by=user
    from MAIL_BOX

    end

    Im not sure whether these syntax are correct
    Because Im not getting the correct date and time out put
    Can some one kindly post some insert and update triggers or please show me how to fix the code what I have written.


    Thank you
    Deeishan

  2. #2
    Join Date
    May 2005
    Location
    South Africa
    Posts
    1,365
    Provided Answers: 1
    It is not clear from your code what you are trying to do
    Here are some links
    Insert trigger example
    Update trigger example

  3. #3
    Join Date
    May 2007
    Posts
    10

    Unhappy Writing insert and update triggers on ASE 15.0

    Thanks for your reply

    Actually that is not what I want, I want to update the record which I insert and show me on saying record been updated an display it on last creation_date record with who created_by say dbo, or deeishan and the update trigger should show me saying update_date filed with the update date and updated_by column with the who updated in last record both should display with the system date and time correctly

    Please show me some examples or explain me how to write this


    Thanks you
    Deeishan

Posting Permissions

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