首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > 数据库 > oracle >

orcale如何在查询语句里面定义变量

2013-01-25 
orcale怎么在查询语句里面定义变量我想在写查询语句的时候,将条件赋给变量,不知道怎么写,SQL的话,比如:dec

orcale怎么在查询语句里面定义变量
我想在写查询语句的时候,将条件赋给变量,不知道怎么写,
SQL的话,比如:
declare @temp varchar(20) 
set @temp='SRT13000007'
select * from  einvgtfhd where efhno=@temp
但我不知道orcale怎么写
[解决办法]

declare temp varchar(20);
begin 
temp:='SRT13000007';
//--select *  from  einvgtfhd where efhno=temp;
ORACLE不支持这种查询,这样的查询必需有游标。
end;

[解决办法]
hr@ORCL> var v_tt number
hr@ORCL> select * from employees where employee_id=&v_tt;

热点排行
Bad Request.