orcale怎么在查询语句里面定义变量

ufo481 2013-01-21 04:15:08
我想在写查询语句的时候,将条件赋给变量,不知道怎么写,
SQL的话,比如:
declare @temp varchar(20)
set @temp='SRT13000007'
select * from einvgtfhd where efhno=@temp
但我不知道orcale怎么写
...全文
659 2 打赏 收藏 转发到动态 举报
写回复
用AI写文章
2 条回复
切换为时间正序
请发表友善的回复…
发表回复
linwaterbin 2013-01-21
  • 打赏
  • 举报
回复
hr@ORCL> var v_tt number hr@ORCL> select * from employees where employee_id=&v_tt;
我看见佛 2013-01-21
  • 打赏
  • 举报
回复
declare temp varchar(20);
begin 
temp:='SRT13000007';
//--select *  from  einvgtfhd where efhno=temp;
ORACLE不支持这种查询,这样的查询必需有游标。
end;

17,377

社区成员

发帖
与我相关
我的任务
社区描述
Oracle 基础和管理
社区管理员
  • 基础和管理社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧