如何忽略对 Oracle SQL 语句中存储的“&lt”和“&gt”文本的响应?

How to ignore responding to stored '&lt' and '&gt' text in Oracle SQL statement?

我在 SQL 命令行中编写下面的 sql 查询时遇到问题。它问我 "Enter a value for lt:" 然后给出错误

ORA-00933: SQL command not properly ended

我需要正确阅读包含“<”或“>”作为字符串的列。如何编辑查询以使其有效?

Delete from authorization1 
where role = 'staff' AND object = ' /department/gradstudent/gpa' 
AND predicate = ' & l t ; 2.0') AND action = 'read' 

假设您使用 SQL*PlusSQL Developer 作为前端,这个问题是 &foo 是定义替换变量的语法。你可以

set define off;

在 运行 脚本之前禁用替代变量。这将阻止前端提示您输入值。