当我运行这个SQL时,我得到这个错误
ORA-00911: invalid character
00911. 00000 - "invalid character"
*Cause: The identifier name started with an ASCII character other than a
letter or a number. After the first character of the identifier
name, ASCII characters are allowed including "$", "#" and "_".
Identifiers enclosed in double quotation marks may contain any
character other than a double quotation. Alternate quotation
marks (q'#...#') cannot use spaces, tabs, or carriage returns as
delimiters. For all other contexts, consult the SQL Language
Reference Manual.
*Action: Check the Oracle identifier naming convention. If you are
attempting to provide a password in the IDENTIFIED BY clause of
a CREATE USER or ALTER USER statement, then it is recommended to
always enclose the password in double quotation marks because
characters other than the double quotation are then allowed.
Error at Line: 2 Column: 1
select trim(ps_scrpt.M_NAME) "Processing Script", trim(actset.M_LABEL) "Batch of table feeders", trim(actset.M_FLTTEMP) "Global Filter", trim(actset.M_TAGDATA) "Label of data",
trim(scanner_tmpl.M_TEMPLATE) "Scanner Template", trim(bat.M_LABEL) "Table Feeder", trim(feeder_ext.M_OUTPUT) "Reporting Table", trim(feeder_ext.M_MAIN) "M_MAIN",
case rep_def.M_TYPE
when 0 then 'Dynamic Table Based REP table'
when 1 then 'Data Dictionary Based REP table'
when 2 then 'SQL Based REP table'
else 'Unknown Type'
end as "M_TYPE",
trim(rep_dyn.M_DYN_TABLE) "Dynamic Table"
from ACT_SET_DBF actset, ACT_SETREP_DBF setrep, ACT_BAT_DBF bat, ACT_DYN_DBF feeder_ext, PROCESS#PS_ITEM_DBF ps_item,
PROCESS#PS_SCRPT_DBF ps_scrpt, RPO_DMSETUP_TABLE_DBF rep_def, RPO_DMSETUP_DYN_TABLE_DBF rep_dyn, SCANNERCFG_DBF scanner_tmpl
where actset.M_REF = setrep.M_REFSET
and setrep.M_REFBAT = bat.M_REF
and bat.M_REF = feeder_ext.M_REF
and scanner_tmpl.M_REFERENCE (+)= actset.M_SCNTMPL
and ps_item.M_PARAM_LAB2 (+)= actset.M_LABEL -- '(+)' incase the batch is not attached to a processing script
and ps_scrpt.M_REF (+)= ps_item.M_REF -- '(+)' incase the batch is not attached to a processing script
and rep_def.M_LABEL (+)= feeder_ext.M_OUTPUT -- '(+)' incase the feeder/ext does not have a reporting table
and rep_dyn.M_REFERENCE (+)= rep_def.M_REFERENCE -- '(+)' incase the reporting table does not have a dynamic table
--and feeder_ext.M_OUTPUT like '%REPORTING_TABLE%' -- reporting table
--and rep_dyn.M_DYN_TABLE like '%DYN_TABLE%' -- dynamic table
--and bat.M_LABEL like 'TABLE_FEEDER%' -- table feeder
and actset.M_LABEL in
(
'E_CS_BF',
'E_DT_BF'
)
我想得到结果
1条答案
按热度按时间huwehgph1#
虽然没有任何明显的错误,并且从正常页面视图复制查询不会报告相同的错误,但如果从编辑视图复制查询,则会出现相同的错误。
您可以在十六进制编辑器中检查原始代码,或者使用
dump('...', 16)
查看您实际拥有的字符。例如,dumping第2行显示:检查该文本会发现,在很多地方存在非中断空格(unicode 00 a0,UTF-8 hex c2 a0);第2行开头6个(忽略Markdown格式的4个空格),该行结尾1个,第3行开头6个,第4行开头8个,以此类推。这些是导致错误的原因,因为Oracle不会将它们解释为纯空白,而对于普通空格、制表符或换行符,Oracle会将它们解释为纯空白。
你可能从一些编辑器中复制了这些空格,这些编辑器将普通空格转换为不间断空格,或者从一个使用它们进行格式化的示例中复制了这些空格,或者你也可以自己键入它们,尽管这似乎不太可能。
您需要查找所有这些字符并将其替换为普通空格,这可以在文本编辑器中完成;或者全部重新输入。重新缩进每一行可以去掉大部分,但是你也需要去掉第2行和第8行的末尾。
fiddle,在用普通空格替换所有88个非中断空格之前和之后。(当然,对于ORA-00942,'after'仍然失败,因为我们没有您的表,但没关系-ORA-00911已经消失了。)第二行现在转储为: