我创建一个经典报告(基于功能)用下面的代码:的Oracle APEX错误ORA-01460 ORA-02063
declare
q long;
begin
-- The query with any conditions always applied
q := 'select * from name_selection_atnd where 1 = 1';
-- If all items are null then kill query
if :P500_FN is null
and :P500_LN is null
then
q := q || ' and name_said = 0'; --will always return 0 rows
end if;
-- Append any optional conditions
if :P500_FN is not null then
q := q || ' and name_first_name = :P500_FN';
end if;
if :P500_LN is not null then
q := q || ' and name_last_name = :P500_LN';
end if;
return q;
end;
我的最终代码将需要包含更多的项目,除了第一个和最后一个搜索名字,但现在我只用这两个参数进行测试。当我只填写名字时,搜索起作用。当我只填写姓氏时,它可以工作。当我输入第一个姓氏时,出现错误ORA-01460和ORA-02063。
我会做什么错?
什么是你输入'P500_FN'。为什么你在任何地方使用绑定变量。在声明中只使用一次从绑定变量获取值到局部变量中。对这些变量进行比较。 –
我正在输入一个字符串。只要一个人的名字 –
你能给出完整的错误信息,而不仅仅是代码? – MT0