0

I'm currently using the mySQL common schema package along with the split() function, but I'm struggling to get a working JOIN query to work?

set @script := "
    split({size:2000} :
        UPDATE world
        SET world.CountryName = (
            SELECT country.nicename 
            FROM country
            WHERE country.iso = world.Country
        )
    )
    {
        throttle 4;
        SELECT $split_total_rowcount AS 'rows updated so far';
    }
";
call common_schema.run(@script);

When running this query, it produces the following:

#1644 - QueryScript error: [split() cannot deduce split table name. Please specify explicitly] at 34: "UPDATE world

SET world.Country

As for why I'm trying to split my UPDATE query into chunks, is because it's trying to update a table that's got 3M+ rows & is struggling when doing the query on it's own

Curtis
  • 2,646
  • 6
  • 29
  • 53
  • I don't know your framework at all, but you can always check running the raw update query directly on MySQL. Obviously, if that has a problem then so would your code. – Tim Biegeleisen Jul 09 '18 at 01:58
  • I have never used split. But, do you think it wants you to reference your database in your table call? – Bleach Jul 09 '18 at 03:13

1 Answers1

0

Please specify explicitly appears to refer to using this format:

Multiple tables operations; explicit declaration of splitting table:

split (schema_name.table_name: statement operating on multiple tables)

statement;

https://shlomi-noach.github.io/common_schema/query_script_split.html

See also explicit declaration.

Community
  • 1
  • 1
Michael - sqlbot
  • 169,571
  • 25
  • 353
  • 427