• First, db1 has:

    SELECT ObjectID, Media, artist, place, gender from db1.view1

    Example:

    1, paint, Arthur, Europe, male;

    2, paint, John, US, male;

    3, wood, Ann, Europe, female;

    Second, db2 has:

    SELECT CustomData.Field_ID, CustomData.Record_ID, FieldDef.Name,

    CustomData.StringValue

    FROM CustomData LEFT OUTER JOIN

    FieldDef ON FieldDef.Field_ID = CustomData.Field_ID

    Example for CustomData table (Field_ID, Record_ID, StringValue):

    10, 18031,1

    10141, 18031,Arthur

    Example for FieldDef table (Field_ID, Name):

    10, ObjectID

    10140, Media

    10141, artist

    10142, place

    10222, gender

    What I need to check: If Object_ID = 1 (or any other Object_ID which is in db1.view) exists in CustomData.

    If yes, then INSERT/UPDATE CustomData table to have:

    10, 18031,1

    10140, 18031, paint

    10141, 18031, Arthur

    10142, 18031, Europe

    10222, 18031, male

    I hope I explained better this time, it looks quite difficult for me, even to explain.