Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
CODE PROJECT For Those Who Code
  • Home
  • Articles
  • FAQ
Community
  1. Home
  2. Database & SysAdmin
  3. Database
  4. Triggers

Triggers

Scheduled Pinned Locked Moved Database
tutorial
4 Posts 2 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • D Offline
    D Offline
    dandamudi padma
    wrote on last edited by
    #1

    Hi, can anyboby tell how to write triggers as my req is if a row is inserted in table1 the same row has to be inserted on table2.. regards padma padma

    P 1 Reply Last reply
    0
    • D dandamudi padma

      Hi, can anyboby tell how to write triggers as my req is if a row is inserted in table1 the same row has to be inserted on table2.. regards padma padma

      P Offline
      P Offline
      pmarfleet
      wrote on last edited by
      #2

      Have you read the documentation? What code have you written so far?

      Paul Marfleet "No, his mind is not for rent To any God or government" Tom Sawyer - Rush

      D 1 Reply Last reply
      0
      • P pmarfleet

        Have you read the documentation? What code have you written so far?

        Paul Marfleet "No, his mind is not for rent To any God or government" Tom Sawyer - Rush

        D Offline
        D Offline
        dandamudi padma
        wrote on last edited by
        #3

        hi till now i wrote CREATE TRIGGER trginsert AFTER INSERT ON table1 FOR EACH ROW INSERT INTO table2(unit,id) values('888','999'); i will get data through a device whenever a record is inserted into the master table the same record has to be added into another table this is my req hope i was clear padma

        P 1 Reply Last reply
        0
        • D dandamudi padma

          hi till now i wrote CREATE TRIGGER trginsert AFTER INSERT ON table1 FOR EACH ROW INSERT INTO table2(unit,id) values('888','999'); i will get data through a device whenever a record is inserted into the master table the same record has to be added into another table this is my req hope i was clear padma

          P Offline
          P Offline
          pmarfleet
          wrote on last edited by
          #4

          When a trigger fires for an insert/update, the new data can be accessed through a logical table named inserted.

          Paul Marfleet "No, his mind is not for rent To any God or government" Tom Sawyer - Rush

          1 Reply Last reply
          0
          Reply
          • Reply as topic
          Log in to reply
          • Oldest to Newest
          • Newest to Oldest
          • Most Votes


          • Login

          • Don't have an account? Register

          • Login or register to search.
          • First post
            Last post
          0
          • Categories
          • Recent
          • Tags
          • Popular
          • World
          • Users
          • Groups