declare v_card_id varchar2(40);--定义变量; v_cur sys_refcursor; begin v_card_id := 'EE9935F5'; --给变量赋值; open v_cur for select * from 表 where 字段=v_card_id;
[quote=引用 7 楼 gioh0022 的回复:]
还有这种动态变量绑定 execute immediate 'select * from table where col=:1' using var1;
[quote=引用 4 楼 gioh0022 的回复:] [quote=引用 3 楼 yenange 的回复:] [quote=引用 1 楼 zlloct 的回复:]
[quote=引用 3 楼 yenange 的回复:] [quote=引用 1 楼 zlloct 的回复:]
[quote=引用 1 楼 zlloct 的回复:]
定义变量; 给变量赋值; select * from 表where 字段=变量; 上面的SQL语句在SQL Server中使用是非常简单的, 但小弟初学oracle, 不明白oracle如何处理, 请各位大侠指点!
17,377
社区成员
95,128
社区内容
加载中
试试用AI创作助手写篇文章吧