• Thanks Phil - it's not quite a solution but it's a lead. So the following works.

    TRUNCATE TABLE profiler_current.email_profiler

    go

    INSERT INTO

    profiler_current.email_profiler( email_address)

    SELECT

    gc.`E-mail 2 - Value`

    FROM

    src_google_current.google_contacts gc

    UNION

    SELECT

    gc.`E-mail 3 - Value`

    FROM

    src_google_current.google_contacts gc

    UNION

    SELECT

    gc.`E-mail 4 - Value`

    FROM

    src_google_current.google_contacts gc

    UNION

    SELECT

    Email

    FROM

    src_sfdc_current.sfdc_contacts sc

    UNION

    SELECT

    Private_Email__c

    FROM

    src_sfdc_current.sfdc_contacts sc

    go

    (though I'm not entirely sure why). The problem this then gives is that the script no longer works if I run it native in mysql. issuing the command 'delimiter go' at the start of the script helps, but, this falls over if the script has the string 'go' (which occurs twice for example in '......FROM

    src_google_current.google_contacts gc......).

    So there is a bit more to it but maybe your input and these comments will trigger further comment.

    Incidentally after opening the connection but before issuing the main sql I am issuing

    set sql_mode='STRICT_TRANS_TABLES,NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION,ANSI_QUOTES';