简体   繁体   English

Oracle Postgres 中的 UTL_FILE 异常替代方案

[英]Oracle UTL_FILE exceptions alternatives in Postgres

I'm migrating an Oracle stored procedure to AWS Aurora Postgres which has UTL_FILE operations to read and write in external files.我正在将 Oracle 存储过程迁移到 AWS Aurora Postgres,它具有UTL_FILE操作来读取和写入外部文件。 In the Exception part, I have all these exception types used.在异常部分,我使用了所有这些异常类型。 UTL_FILE.invalid_path , UTL_FILE.invalid_operation , UTL_FILE.invalid_mode , UTL_FILE.read_error , UTL_FILE.write_error , and WHEN OTHERS . UTL_FILE.invalid_pathUTL_FILE.invalid_operationUTL_FILE.invalid_modeUTL_FILE.read_errorUTL_FILE.write_errorWHEN OTHERS

Is it possible to handle all these exceptions in Postgres or should I go for orafce extension?是否可以在 Postgres 中处理所有这些异常,或者我应该 go 进行orafce扩展?

What I know, The AWS Aurora Postgres uses Orafce too据我所知,AWS Aurora Postgres 也使用 Orafce

https://aws.amazon.com/about-aws/whats-new/2020/06/amazon-aurora-supports-postgresql-versions-117-1012-and-9617-and-adds-global-database-for-postgresql-117/ https://aws.amazon.com/about-aws/whats-new/2020/06/amazon-aurora-supports-postgresql-versions-117-1012-and-9617-and-adds-global-database-for- postgresql-117/

Postgres has not custom named exceptions like Oracle, so you have to rewrite your code little bit, you have to check error message instead - for example - Oracle's UTL_FILE.write_error is a Postgres's RAISE exception (named raise_exception - P0001 ) with error message (available in SQLERRM variable or via GET STACKED DIAGNOSTICS ) is "UTL_FILE_WRITE_ERROR" . Postgres 没有像 Oracle 这样的自定义命名异常,所以你必须稍微重写你的代码,你必须检查错误消息 - 例如 - Oracle 的UTL_FILE.write_error是 Postgres 的 RAISE 异常(名为raise_exception - P0001 )带有错误消息(可用在SQLERRM变量中或通过GET STACKED DIAGNOSTICS )是"UTL_FILE_WRITE_ERROR"

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 EMR - Airflow 运行 scala jar 文件 airflow.exceptions.AirflowException - EMR - Airflow to run scala jar file airflow.exceptions.AirflowException Cloud Endpoints 门户已弃用 - 替代方案? - Cloud Endpoints Portal is deprecated - alternatives? 地点的替代品 API 自动完成 Expo React Native - Alternatives for Places API Autocomplete for Expo React Native 诊断 postgres 中丢失的索引 - Diagnosing missing index in postgres 将 AWS RDS postgres db 与可写 RDS postgres db 同步 - Sync AWS RDS postgres db with writable RDS postgres db 刷新postgres物化视图的性能 - performance of refreshing postgres materialized view 将 aws postgres db 连接到 vercel - Connect aws postgres db to the vercel Twilio - 电话查询 requests.exceptions.SSLError - Twilio - Phone Lookup requests.exceptions.SSLError 只有在 Flutter 中没有异常时才显示加载指示器 - Show loading indicator only if there's no exceptions in Flutter 将带有分号分隔符的 CSV 文件从 S3 导入到 RDS Postgres 数据库 - Importing CSV file with semicolon delimiters from S3 to RDS Postgres database
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM