3、oracle迁移到postgres-执行动态sql传参不同

发布时间 2023-08-23 11:28:52作者: 站着说话不腰疼

oracle迁移到postgres-执行动态sql传参不同

在sql字符串中,会动态传入值,使用阿拉伯数据定义传参的个数。

1、oracle使用的是:1

execute immediate 'select * from sys_stu where stu_name = :1' using '小明';

2、postgres使用的是$1

execute immediate 'select * from sys_stu where stu_name = $1' using '小明';