ORA-00923: FROM keyword not found where expected
今天偶然查询Oracle隐含参数,想在从网上找到大神写的语句中加一个描述参数作用的列,发生ORA-00923,做个记录
SYS@honor1>select2x.ksppinmname,3y.ksppstvlvalue,4y.ksppstdfisdefault,5x.ksppdescdesc,6decode(bitand(y.ksppstvf,7),1,'MODIFIED',4,'SYSTEM_MOD','FALSE')ismod,7decode(bitand(y.ksppstvf,2),2,'TRUE','FALSE')isadj8from9sys.x$ksppix,10sys.x$ksppcvy11where12x.inst_id=userenv('Instance')and13y.inst_id=userenv('Instance')and14x.indx=y.indxandx.ksppinmlike'%¶meter%'15orderby16translate(x.ksppinm,'_','')17/Entervalueforparameter:policyold14:x.indx=y.indxandx.ksppinmlike'%¶meter%'new14:x.indx=y.indxandx.ksppinmlike'%policy%'x.ksppdescdesc,*ERRORatline5:ORA-00923:FROMkeywordnotfoundwhereexpected
经过仔细比对,该问题由于第五行,使用了系统保留关键字desc导致,改为describe,问题解决。
另外,对上述查询中ISMOD、ISADJ经过研究含义如下:
ISMODIFIEDVARCHAR2(10)Indicateswhethertheparameterhasbeenmodifiedafterinstancestartup:•MODIFIED-ParameterhasbeenmodifiedwithALTERSESSION•SYSTEM_MOD-ParameterhasbeenmodifiedwithALTERSYSTEM(whichcausesallthecurrentlyloggedinsessions'valuestobemodified)•FALSE-ParameterhasnotbeenmodifiedafterinstancestartupISADJUSTEDVARCHAR2(5)IndicateswhetherOracleadjustedtheinputvaluetoamoresuitablevalue(forexample,theparametervalueshouldbeprime,buttheuserinputanon-primenumber,soOracleadjustedthevaluetothenextprimenumber)
声明:本站所有文章资源内容,如无特殊说明或标注,均为采集网络资源。如若本站内容侵犯了原著者的合法权益,可联系本站删除。