兼容性判定
公开资料依据 · 建议 PoC 复核支持度partial
严重度major
置信度medium
依据规则ora.func.nanvl
怎么改
CASE WHEN value = 'NaN'::float8 THEN fallback ELSE value END
判定说明
Whale 脚本定义 NANVL,但 NaN 类型、隐式转换和返回类型仍需验证;结论为 doc_based 草案,建议 PoC 复核
库侧 / 应用侧路径
库侧改造
可行:用目标 NaN 判定加 CASE,或经批准安装 orafce
应用侧改造
可行:在数值读取层统一归一 NaN
推荐路线:db_side。验证建议:NaN、NULL、Infinity 与普通数值五类输入逐项比对
规则样例
SELECT NANVL(reading, 0) FROM sensor
UPDATE sensor SET reading = NANVL(reading, :fallback)
SELECT NVL(reading, 0) FROM sensor
参考来源
- https://docs.opengauss.org/zh/docs/6.0.0-RC1/docs/ExtensionReference/whale%E6%A6%82%E8%BF%B0.html
- https://docs.opengauss.org/zh/docs/6.0.0-RC1/docs/ExtensionReference/whale%E5%AE%89%E8%A3%85.html
- https://docs.opengauss.org/zh/docs/6.0.0-RC1/docs/ExtensionReference/whale%E9%99%90%E5%88%B6.html
- https://docs.opengauss.org/zh/docs/6.0.0-RC1/docs/ExtensionReference/whale-%E6%9D%A1%E4%BB%B6%E8%A1%A8%E8%BE%BE%E5%BC%8F%E5%87%BD%E6%95%B0.html
- https://docs.opengauss.org/zh/docs/6.0.0-RC1/docs/ExtensionReference/whale-%E6%95%B0%E5%AD%97%E6%93%8D%E4%BD%9C%E5%87%BD%E6%95%B0%E5%92%8C%E6%93%8D%E4%BD%9C%E7%AC%A6.html
- https://github.com/opengauss-mirror/Plugin/blob/e3a0cf2ae9bbcee1aa103497f6eca1b1152a4146/contrib/whale/sql_script/plugin_orafce_functions.sql
- https://github.com/darold/ora2pg/blob/97015451a4d1cfbee888f2e6efe7ff68c239a9b5/lib/Ora2Pg/PLSQL.pm#L88-L223
- https://github.com/orafce/orafce/blob/841978f4ec493492bb57fd12415959695cae1b64/README.asciidoc#L786-L943
相关改造点
- ORACLE → opengauss 6.0 A 模式 全部改造点
- opengauss 6.0 A 模式 兼容性总览
- ORACLE 迁移国产库总览
- ORACLE ALTER SESSION SET 会话参数 迁移 opengauss 6.0 A 模式 怎么改
- ORACLE 关联数组(INDEX BY 表) 迁移 opengauss 6.0 A 模式 怎么改
- ORACLE AT TIME ZONE 时区表达式 迁移 opengauss 6.0 A 模式 怎么改
- ORACLE 自治事务(PRAGMA AUTONOMOUS_TRANSACTION) 迁移 opengauss 6.0 A 模式 怎么改
- ORACLE 视图 BEQUEATH 子句 迁移 opengauss 6.0 A 模式 怎么改
- ORACLE BFILE 外部文件类型 迁移 opengauss 6.0 A 模式 怎么改