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

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 '小明';
posted @ 2023-08-23 11:23  站着说话不腰疼  阅读(51)  评论(0)    收藏  举报