将视图从 Oracle 传输到 MySQL 数据库时出错

Error Transporting a View From Oracle to MySQL DB

我正在将其他人的视图从 Oracle 数据库迁移到 Mysql 数据库。我不熟悉 table(cast(multiset())) 运算符,所以我不知道如何将其转置为 MySql

给我错误的代码部分如下:

SELECT csCOUNTRY.ID,  csCOUNTRY.COUNTRY_ID,
      trim(regexp_substr(COUNTRY_ID, '[^;]+', 1, levels.column_value)) AS COUNTRY_ID_2  
FROM table_study csCOUNTRY, 
       table(
           cast(
           multiset(select level from dual connect by  level <= length (REGEXP_REPLACE(COUNTRY_ID, '[^;]+'))  + 1) as sys.OdciNumberList)
       ) 
           levels)

我收到的错误是:

#1064 - You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'table(cast(multiset(select level from dual connect by level <= length (REGEXP_R' at line 255

如何正确转置它?

多播将行转换为单个 table 类型。 Oracle table 的列类型可以是标准的 Oracle SQL 类型(number、char、varchar2)或用户定义的 table 类型。

但是,这里的强制转换和多播运算符是多余的。 下面的查询应该给出相同的结果:

SELECT csCOUNTRY.ID,  csCOUNTRY.COUNTRY_ID,
      trim(regexp_substr(COUNTRY_ID, '[^;]+', 1, levels.lvl)) AS COUNTRY_ID_2  
FROM table_study csCOUNTRY, 
     (select level lvl 
        from dual 
     connect by  level <= length (REGEXP_REPLACE(COUNTRY_ID, '[^;]+'))) levels