老师好,又有问题了,说是下面的这个sql标示符过长,在pl/sql里提示的错误,求指点
selecta.al_data,a.al_code,a.al_desc,(whenal_data='Pass'andal_code='300'andal_desc='It...
select a.al_data,a.al_code,a.al_desc,(when al_data = 'Pass' and al_code = '300' and
al_desc =
'It has stopped 2 hours.Pls check "users\cusotm\in" directory' then
'一级'
when al_data = 'JYJY' and al_code = '300' and
al_desc =
'It has stopped 2 hours.Pls check "users\ciq\in" directory' then
'一级'
when al_data = 'PASSINFO' and al_code = '750' and
al_desc =
'PASSINFO DataBase Can’t Connect!' then
'一级'
when al_data = 'PTAEDI' and al_code = '701' and
al_desc =
'SomeThing Error Please check DB GJXX-it' then
'一级'
when al_data = '不定' and al_code = '200' and
al_desc =
'Trigger has recieve more files from xxx ,System stop it' then
'二级'
end) as d
from alert_log a
去掉al_desc这个字段就可以执行 展开
al_desc =
'It has stopped 2 hours.Pls check "users\cusotm\in" directory' then
'一级'
when al_data = 'JYJY' and al_code = '300' and
al_desc =
'It has stopped 2 hours.Pls check "users\ciq\in" directory' then
'一级'
when al_data = 'PASSINFO' and al_code = '750' and
al_desc =
'PASSINFO DataBase Can’t Connect!' then
'一级'
when al_data = 'PTAEDI' and al_code = '701' and
al_desc =
'SomeThing Error Please check DB GJXX-it' then
'一级'
when al_data = '不定' and al_code = '200' and
al_desc =
'Trigger has recieve more files from xxx ,System stop it' then
'二级'
end) as d
from alert_log a
去掉al_desc这个字段就可以执行 展开
展开全部
case when的语句是这样写的么?
应该是
case when .... then......
when.......then......
.....end
你这里少了case这个单词。
应该是
case when .... then......
when.......then......
.....end
你这里少了case这个单词。
更多追问追答
追问
是忘掉了,那它提示标识符过长这个怎么解?老师
追答
很简单,没找到case关键字,他就不认为这是一个case when的语句,而是一个字段,毕竟oracle没有以when开头的语句,作为一个字段来说,你认为这一串能显示什么?理所当然的什么都不能显示,但是在这一串中有字符型的数据,这个内容oracle认识,但是这个和其他的连在一起,他就不认识了,所以就显示标识符过长,也就是有一部分东西他不认识的意思。
来自:求助得到的回答
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询