How can i create trriger when inserting record in foreign key

i have two table
ward(id,erf_no,zone)
property(id,war_id,Address_Line)
ward.id = property.war_id
i what to create new ward id whenever am inserting new record in property
something like this but i don't what to insert in property id i what to insert in ward table new id
CREATE OR REPLACE TRIGGER ASSIGN_propid
BEFORE INSERT ON SMS_PROPERTIES FOR EACH ROW
BEGIN
IF :NEW.ID IS NULL OR :NEW.ID < 0 THEN
SELECT  SMS_MAST1_SEQ.NEXTVAL
INTO :NEW.ID
FROM DUAL;
END IF;
END;
{code]                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   

Here's an example:
http://www.oracle-base.com/articles/misc/populating-master-detail-fks-using-sequences.php

Similar Messages

  • How can you create a simple insert or update trigger

    I am trying to create a simple insert or update trigger to timestamp an xml document when I load it into my XML DB repository but I always get an error trying to compile the trigger.
    "ORA-25003: cannot change NEW values for this column type in trigger"
    Here is my PL/SQL:
    CREATE OR REPLACE TRIGGER "PLCSYSADM"."PLCSYSLOG_TIMESTAMP"
    BEFORE
    INSERT
    OR UPDATE ON "PLCSYSADM"."PLCSYSLOG"
    FOR EACH ROW BEGIN
    :new.sys_nc_rowinfo$ := xmltype('<datestamp>' || SYSDATE || '</datestamp>');
    END;
    Does anyone have an example that works ?
    Thanks in advance
    Niels Montanana

    http://developer.apple.com/referencelibrary/HardwareDrivers/idxUSB-date.html

  • Can Auto create bookmark when insert a page?

    I know that when I combine multiple PDF file, bookmarks will be automatically created with the file names. However, when I insert page into this combined document, the bookmarks did not auto create. Similarly when I delete a page from this document, the bookmark did not get updated also,
    Did I miss out some steps or even version X also does not have this ability?

    See also:
    *Add Bookmark Here 2: https://addons.mozilla.org/firefox/addon/add-bookmark-here-2/
    You can open the Bookmarks sidebar to make it easier to drag a bookmark to a specific folder.
    *You can toggle the Bookmarks sidebar on/off via "View > Sidebar > Bookmarks" or "Ctrl+B" (Command+B on Mac)
    You can also find a button in the Customize window to toggle the bookmarks sidebar.
    *Firefox menu button > Options > Toolbar Layout
    *View > Toolbars > Customize

  • How can I create a triggered data recording VI?

    So I have a force/torque transducer and I have a basic program already that records the data for a brief amount of time after you tell the VI to run.  I've been trying to modify it so that it triggers when a force is applied to the transducer so that it then begins to record data and display as a graph.I'm having some problems with the triggering.  The trigger works fine, but it only records for as long as the force is applied, not for a set amount of time.  Any ideas how I can do this?

    Here is the Analog Trigger SubVI that I am using in the program.  I sort of see what you are talking about in regards to modifying the subVI to do what I want, but I'm not certain how much of the original VI must be re-written into the subVI to make it work. Thanks for the reply.
    Attachments:
    SW Analog Triggering_DAQmx.vi ‏26 KB

  • How can i hear myself when I record vocals?

    I'm using Garageband 1 with a Duet Pre-amp.

    Here's an example:
    http://www.oracle-base.com/articles/misc/populating-master-detail-fks-using-sequences.php

  • How can I get Siri to insert a pause (,) when voice-dialing a number?

    I join a lot of conference calls with my iPhone.  The conference bridges have phone numbers that follow this pattern:
    (123) 456-7890,1234567#
    How can I get Siri to insert the pause (,) character, and the pound (hash) sign, into the phone number when voice-dialing?
    When I say "pause" Siri inserts the word "pause" as a literal string: 
         Example: (123) 456-7890 pause 1234567
    When I say "comma" Siri will insert a comma (,) into the dial string, but the Phone app ignores everything after the comma and does not dial it:
         Example: (123) 456-7890, 1234567   results in only this being dialed:  (123) 456-7890
    When I say "pound" or "hash" Siri inserts the words "pound" or "hash" as literal strings:
         Example: (123) 456-7890, 1234567 pound     instead of (123) 456-7890,1234567#

    If it is your own conference bridge you can create a new contact named "My Bridge" and enter your 1800 number along with a "wait" command and pass code and #.  It would look something like this 1-800-555-5555;12345678#.  This way when you tell Siri to call "My Bridge" she'll dial and then you'll notice an option in the lower left to dial the pass code.  Press that and you're all set. You can do the same for frequent conference bridges you connect to.  Hope this helps.

  • How can I create a text pop up window in my Pages document? I want text to pop up when the reader hovers his/her cursor over a certain word.

    How can I create a text pop up window in my Pages document? I want text to pop up when the reader hovers his/her cursor over a certain word in the document. I am teacher. So for example when a student came to word he/she did not know, if he/she hovered the cursor over the word, a defintion or other information would appear.  You can do this in Word using bookmarks/hyperlinks but I can't figure this out in Pages. I can link it to another point in my Pages document but I just need the text to pop up - not take the reader to another location.  THANK YOU!!!!!!

    Have you tried Word for Mac?
    You will need to test if links survive export or printing to .pdf
    Peter

  • I have an edit button in my e mail account but when I press it I don't get the ''get new mailbox' button. How can I create e mail folders? Thanks.

    I want to create e mail folders for my goole account. I go to the account and as suggested in the forum i tap on edit. Then instead of getting at the botton a button that says 'new mailbox' i get 2 boxes one red that says delete and one blue that says move. This is on an ipad 2. I have also an ipad 3 and there it does work. I have checked the settings in both ipads and they seem identical to me.
    How can I create the foldesr then on teh ipad 2?
    Thanks a lot!

    You need to be in the mailbox list for the account when you tap edit.
    Sounds like you might be trying to do it from insider you Inbox.
    Matt

  • How can I create accurate decimal dimensions when creating a new document or using the art board in Illustrator CS6? When I type in a number with a decimal, it automatically rounds the number up.

    How can I create accurate decimal dimensions when creating a new document or using the art board in Illustrator CS6? When I type in a number with a decimal, it automatically rounds the number up.

    For my part you are welcome, sdowers.
    Unfortunately, the uncertainty arising from the rounding has been up several times here in this forum.
    I just came to remember a warning that needs to be given:
    The rounding of the representation of a numerical value may be harmless in itself, but if you use it for any operation that changes the value, such as multiplication or whatever, things will go wrong because the operation will be made on the basis of the rounded value instead of the true value. So, as in your first case in post #2, 39.625 rounded to 39.63 will become 79.26 instead of 79.25.

  • When i bought this iMac i failed to register correctly and as i am trying to install a printer i need to do this when i am logging on. How can i create new password

    When i bought this iMac i failed to register correctly and as i am trying to install a printer i need to do this when i am logging on. How can i create new password

    See
    http://osxdaily.com/2011/08/24/reset-mac-os-x-10-7-lion-password/ and
    http://osxdaily.com/2011/09/19/change-password-mac-os-x-10-7-lion-without-knowin g-current-password/
    which also apply to Mtn Lion and Macericks.

  • How can i use BAPI to insert a few records  into standard table

    Can anyone help me with how can i use BAPI to insert some records into a standard table from an internal table?

    Hi,
    First of All try to Explain your Question first.
    This is a general question without mentioning the Table you want to Update.
    Please give the details before posting a question  so it will help people to understand your Problem.
    Regards
    Sandipan

  • How can i creat apple ID free when i am from georgia?

    how can i creat apple ID free when i am from georgia?

    Anyone can create an Apple ID.
    Instructions here >  Apple - My Apple ID

  • HT4075 I don't have any problems merging the documents by dragging, but when I try to save and open afterwards, only the last shown doc was saved, not the combined files I wanted to merge. I tried save and export, how can I create the file after merging?

    Hi, I'm having trouble saving the documents when merging in Preview. I don't have any problems merging the pdf documents by dragging them in preview, but when I try to save and open afterwards, only the last shown doc was saved, not the combined files I wanted to merge. I've tried save and export, but none merge the documents after saving... how can I create the file (with all the pdf files) after merging?

    That's a comment in the file. It has no effect at all.

  • When i try to create an account on my iphone 5, icloud closes right after accepting the general condition. How can i create my account????

    When i try to create an account on my iphone 5, icloud closes right after accepting the general condition. How can i create my account????

    Reset and try again.
    Reset: Press and hold Power and Home button until Apple logo appears. Release and wait to reboot.

  • How can I create a Face Time account.  I have an Apple ID and password.  When I Google how to create an account all I get is what I need for the system

    I have a 13" MacPro.  How can I create a Face Time account.  I have an Apple ID and password.  When I Google how to create an account all I get is what I need for the system

    You don't need to create an account.   Your use your Apple ID to log into Facetime.
    If you haven't already you will need to download the Facetime App from the Mac App Store.
    https://itunes.apple.com/us/app/facetime/id414307850?mt=12&ls=1
    FaceTime for Mac: Troubleshooting FaceTime - Apple Support

Maybe you are looking for

  • Images still not printing

    In my program, 5 images should be printed, but it only prints one image , the last image I create. I am not sure why this happens, please help. import java.awt.*; import java.awt.event.*; import java.awt.image.*; import java.io.*; import javax.imagei

  • I can't install colornavigator 6.4.6 on my macbook pro retina display

    Colornavigator 6 does not see my Eizo monitor at all yet the mac shows that it is connected. I tried installing the Colornavigator software update but the system wouldn't allow it. Any ideas?

  • Good book for J2EE?

    I know Servlets and JSP and i want to enhance my knowledge with programming and also i have to learn structs, ajax. which is the good book for this.

  • Dynamic classloading without default constructor

    Just wondering if anyone has done dynamic classloading using a constructor other than the default. I know that newInstance() calls the default constructor. But how would you do it without that? Thanks for the help.

  • How do you convert psd files to jpg files?

    Raw photos were converted to psd and then to jpg. The jpg files were imported and some got reconverted to psd files again. How can I convert them back to jpg files so that I can put them in a photo book?