diff --git a/src/database/table.ts b/src/database/table.ts index b2a6381a..f54e673f 100644 --- a/src/database/table.ts +++ b/src/database/table.ts @@ -70,8 +70,8 @@ export default class Table { } static async isPartitioned(schema: string, name: string): Promise { - const sql = `select table_name, partitioned_table from qsys2.sysfiles where table_schema = ? and table_name = ? and partitioned_table is not null and partitioned_table = 'YES'`; - const parameters = [schema, name]; + const sql = `select table_name, partitioned_table from qsys2.sysfiles where ((table_schema = ? and table_name = ?) or (system_table_schema = ? and system_table_name = ?)) and partitioned_table is not null and partitioned_table = 'YES'`; + const parameters = [schema, name, schema, name]; const result = await JobManager.runSQL(sql, {parameters}); return result.length > 0;