Unsupported Screen Size: The viewport size is too small for the theme to render properly.

Sja With Delete From Target

This topic contains 5 replies, has 0 voices, and was last updated by  gonzaloleon 6 years, 1 month ago.

  • Author
    Posts
  • #12872

    gonzaloleon
    Member

    Hi all!

    I'm testing some parameters in sja, and i have a question.

    I'm doing sync in one way, with “where clause present” that checks for some id = X (number of server).

    The Target have all servers rows, 1, 2 and 3. Server 2 syncs one way to the target with where clause id_server = 2, what happens if i check “DELETE FROM TARGET” in sync options?

    Thanks!

  • #34020

    shubh
    Member

    Hi,

    Quoting from documentation here: http://static.webyog…I_for_MySQL.htm

    “If a WHERE clause is specified then it syncs all columns of the table that satisfy the WHERE clause.”

    As case specified by you, by giving “id_server = 2” will sync only those rows of the table that have “id_server = 2”. It will not sync any other rows of the table.

    We have “Don't delete extra rows in target database” option in Database Sync wizard. Quoting from documentation here: http://static.webyog…SQL_Manager.htm

    “The extra rows present in the target database are deleted if you keep the checkbox 'Don't delete extra row(s) in Target database' unchecked.”

  • #34021

    Jan.S
    Member

    However, extra rows will not be deleted under any circumstance when a WHERE clause is used.

  • #34022

    gonzaloleon
    Member
    'Jan.S' wrote:

    However, extra rows will not be deleted under any circumstance when a WHERE clause is used.

    'shubh' wrote:

    Hi,

    Quoting from documentation here: http://static.webyog…I_for_MySQL.htm

    “If a WHERE clause is specified then it syncs all columns of the table that satisfy the WHERE clause.”

    As case specified by you, by giving “id_server = 2” will sync only those rows of the table that have “id_server = 2”. It will not sync any other rows of the table.

    We have “Don't delete extra rows in target database” option in Database Sync wizard. Quoting from documentation here: http://static.webyog…SQL_Manager.htm

    “The extra rows present in the target database are deleted if you keep the checkbox 'Don't delete extra row(s) in Target database' unchecked.”

    Thats right but, take this example:

    One Way sync (with delete extra rows on target)

    Read on Master -> Write changes to Slave

    Where id_server = 2 -> 130 (rows) -> Target: where id_server = 2 -> 134 (rows) -> then delete those extra (4) rows.

    This is possible?

  • #34023

    Jan.S
    Member

    Hi,

    Like I mentioned, whenever a where clause is used, we do not delete any data irrespective of if the “delete extra rows in target” is checked or not. However, we are releasing 10.5 GA within a week, which includes a visual data comparison tool which can be used to delete the extra rows. The beta version with this feature has been released. You can take a look at it and download from here.

    Regards,

    Janani

  • #34024

    peterlaursen
    Participant

    One additional comment: SJA executes the WHERE clause on the source only and not on the target. If we should deleted on target this would be without considering the WHRE clause. That is why we have disabled DELETE when a WHERE clause is used..

  • #34025

    gonzaloleon
    Member
    'peterlaursen' wrote:

    One additional comment: SJA executes the WHERE clause on the source only and not on the target. If we should deleted on target this would be without considering the WHRE clause. That is why we have disabled DELETE when a WHERE clause is used..

    Sure, that's why i post my example for futures developments.

    'Jan.S' wrote:

    Hi,

    Like I mentioned, whenever a where clause is used, we do not delete any data irrespective of if the “delete extra rows in target” is checked or not. However, we are releasing 10.5 GA within a week, which includes a visual data comparison tool which can be used to delete the extra rows. The beta version with this feature has been released. You can take a look at it and download from here.

    Regards,

    Janani

    I'm going to test.

    Thanks!

You must be logged in to reply to this topic.