APEX 5 - 我有以下声明中的经典报告(基于功能):
declare
bamsan varchar(3000);
begin
if v('foo')= 'lansan' then
bamsan := 'select id, cpu_cores, cpu_model, disk_gb from physical_servers where PHYSICALSERVERID like (select LEFTPHYSICALDEVICEID from SAN_PHYS_CON where CONNECTIONID like :meklet_value)';
elsif v('foo')= 'storage' then
bamsan := 'select id, modelis, customerstoragename from storages where storageid like :meklet_value';
elsif v('foo')= 'clusters' then
bamsan := 'select id, memberhostid from clusters_pools where clusterpoolid = :meklet_value';
elsif v('foo')= 'hostname' then
bamsan := 'select id, cpu_cores, cpu_model, disk_gb from physical_servers where PHYSICALSERVERID like (select parentid from hosts where hostname like :meklet_value)';
else
bamsan := 'select id, cpu_cores, cpu_model, disk_gb from physical_servers where PHYSICALSERVERID like :meklet_value';
end if;
return bamsan;
end;
选择elsif v('foo')= 'clusters'...
会出现错误:
ORA-20001:获取列值时出错:ORA-01403:未找到数据
我100%确定表和列是否存在(我可以从SQLDeveloper和Apex SQL命令中运行此选择)。这真的是一个APEX错误还是我错过了什么?
答案 0 :(得分:1)
在这种情况下问题是你的dinamic查询,因为在某些选择中有不同数量的列... 你可以选择“使用通用列名”选项