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

怎么在pl/sql的sql窗口中使用变量

2012-08-15 
如何在pl/sql的sql窗口中使用变量?现在知道可以这样实现:select * from temp_table where student_id&v_s

如何在pl/sql的sql窗口中使用变量?
现在知道可以这样实现:select * from temp_table where student_id=&v_student_id;这样可以跳出一个窗口填写数字。

求教如何能够实现,先定义“v_student_id”这个变量,再将“v_student_id”赋值,然后再使用这个变量?

请注意,是在pl/sql的sql窗口中实现,不是在存储过程和命令窗口中实现。


[解决办法]
declare 
v_student_id number;
begin
------这里写程序段,我想只能这么写了
end;
[解决办法]
declare
v_student_id number;
v_clo number;
begin
v_student_id:=1001;
begin
select temp_column into v_clo from temp_table where student_id=v_student_idend;
exception
when others then
---报错
end;
end;

热点排行