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

oracle存储过程里动态施行SQL

2013-03-26 
oracle存储过程里动态执行SQL……--当传入学习中心编号时? IF vSpotCode is not null THEN???? vWhere:vWhe

oracle存储过程里动态执行SQL

……

--当传入学习中心编号时
? IF vSpotCode is not null THEN
???? vWhere:=vWhere || ' AND ass.SpotCode=' || vSpotCode;
? END IF;
? --当传入学生层次编号时
? IF vLevelCode is not null THEN
???? vWhere:=vWhere || ' AND ass.LevelCode=' || vLevelCode;
? END IF;
? --当传入专业编号时
? IF vSpecCode is not null THEN
???? vWhere:=vWhere || ' AND ass.SpecCode=' || vSpecCode;
? END IF;

……

?execute immediate 'update thesisapplyinfo TAI set TAI.StudyState=105 where TAI.Studentid in
??????????? (select ass.userid from all_studentinfo ass where ass.speccode = A.SPECCODE ' || vWhere || ')';

……


我的异常网推荐解决方案:oracle存储过程,http://www.myexception.cn/oracle-develop/177537.html

热点排行