Results 1 to 8 of 8
  1. #1
    Join Date
    Feb 2009
    Posts
    36

    Question Unanswered: checking record existence??

    hii all,
    can anybody help me how to check whether a particaular record is existing in a table or not...??
    for e.g if there is a record 'TR1' in one table 'A' then while inserting it in table 'B' ,it should display a message 'record' exist in table 'A',u cant insert it here!!!!!

  2. #2
    Join Date
    Aug 2003
    Location
    Where the Surf Meets the Turf @Del Mar, CA
    Posts
    7,776
    Provided Answers: 1
    >can anybody help me how to check whether a particaular record is existing in a table or not...??
    What uniquely identifies this record?
    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.

  3. #3
    Join Date
    Jan 2009
    Location
    Dhaka, Bangladesh
    Posts
    51
    Quote Originally Posted by ANGEL_G
    hii all,
    can anybody help me how to check whether a particular record is existing in a table or not...??
    for e.g if there is a record 'TR1' in one table 'A' then while inserting it in table 'B' ,it should display a message 'record' exist in table 'A',u cant insert it here!!!!!
    write a trigger on table b that execute when you insert a row in it. the trigger check whether a record 'TR1' exist in table 'A' , if exist it display a message 'record' exist in table 'A',u cant insert it here!!!!! ' otherwise insert the row.

    for learn how to write trigger, please surf the net, google can help you a lot
    Mohammad Hasan Shaharear
    E-mail
    Blog: http://shaharear.blogspot.com

  4. #4
    Join Date
    Feb 2009
    Posts
    36
    can anyone provide me the code for trigger???

  5. #5
    Join Date
    Jan 2004
    Location
    Croatia, Europe
    Posts
    4,094
    Provided Answers: 4
    Certainly, but doing so you'd learn almost nothing.

    It is you who should read documentation, see how to create a trigger and develop logic described by @hasan_uiu. Once you produce a syntax error free code, you may come back and ask for additional help.

  6. #6
    Join Date
    Jan 2009
    Location
    Dhaka, Bangladesh
    Posts
    51
    Quote Originally Posted by Littlefoot
    Certainly, but doing so you'd learn almost nothing.

    It is you who should read documentation, see how to create a trigger and develop logic described by @hasan_uiu. Once you produce a syntax error free code, you may come back and ask for additional help.
    Yes, I agree with you and this is the way a forum should work. You don't let other to do your full job.

    At list try first to write the code, if it does not work properly, come back and ask other why your code not working properly.
    Mohammad Hasan Shaharear
    E-mail
    Blog: http://shaharear.blogspot.com

  7. #7
    Join Date
    Feb 2009
    Posts
    36
    hii hasan_uiu,Littlefoot
    thanks for kind advice..i m new to oracle and pl/sql so i need the guidance through this forum.iit takes time to learn the things.
    you people help me,thanks alot.

  8. #8
    Join Date
    Aug 2003
    Location
    Where the Surf Meets the Turf @Del Mar, CA
    Posts
    7,776
    Provided Answers: 1
    >so i need the guidance
    So learn to read manuals, learn to use SEARCH on this forum, learn to use GOOGLE, learn to search on http://asktom.oracle.com
    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
  •