0

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 错误还是我错过了什么?

4

1 回答 1

1

在这种情况下,问题是您的动态查询,因为在某些选择中列数不同...您可以选择“使用通用列名”选项

于 2017-05-25T15:36:48.313 回答