数据库-编程技巧

1、执行动态语句

execute immediate 'select count(1) from '|| tablename into rtn; 

execute immediate ‘字符串’ into 变量列表 using 变量列表  (into 是查询语句的结果赋值给变量。using 是吧变量的值传入语句中对应的:1,:2,…)

2、异常处理

exception when others then 异常处理语句  (要写在程序最后)

原文地址:https://www.cnblogs.com/jingfengling/p/5976056.html