#1
  1. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Apr 2011
    Posts
    5
    Rep Power
    0

    Two Database Comparisons?


    I have two databases called
    a) Old Retailer database
    b) New Retailer Database

    We cant delete old database but we are using and we want to use both of them.

    Now problem

    Both dbs have a table called retailer.

    I want to prevent duplication in them.

    I.e it there is a retailer 12 created in old one new one shldnt allowo us to create retailer

    id---12

    similarly if there is a retailer 13 in new one it shouldnt be created in old table

    retailer ids are unique. its not the case that with retailer id for example 5 there is a

    different retailer in these two tables of diffferent DBS. Its unique

    Now I have to put this criteria

    how can i do it?

    can any body help me please?


    Second questions===================

    if a primary key is auto increment. how can i skip some numbers lets say it is 1,2,3,4

    i want that when next record shld be inserted it shld be 6 not 5. i dont want to feed the value 6. i want to know how to change indexing of primary key to skip some numbers when its set to auto increments. any help wil be appreciated
  2. #2
  3. Contributing User
    Devshed Novice (500 - 999 posts)

    Join Date
    Sep 2006
    Posts
    859
    Rep Power
    388

    Cool


    similarly if there is a retailer 13 in new one it shouldnt be created in old table
    Why would you still be creating retailers in the OLD table?

    You could create a db link from new to old database and have a trigger check if retailer exists before creating.
  4. #3
  5. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Apr 2011
    Posts
    5
    Rep Power
    0
    Originally Posted by LKBrwn_DBA
    Why would you still be creating retailers in the OLD table?

    You could create a db link from new to old database and have a trigger check if retailer exists before creating.
    can you tell me the sample syntax for creating db link and this trigger

    your help will be much appreciated
  6. #4
  7. Contributing User
    Devshed Novice (500 - 999 posts)

    Join Date
    Sep 2006
    Posts
    859
    Rep Power
    388

    Cool


    Is it too difficult for you to check it out in the fine OracleŽ Database SQL Language Reference?

IMN logo majestic logo threadwatch logo seochat tools logo