我找到了一個解決問題的辦法。下面是該PRE_QUERY觸發代碼:
declare
where_str varchar2(512) := 'where 1 = 1';
begin
if (:OBJECTS.TYPE_DESCRIPTION is not null) then
if instr(:OBJECTS.TYPE_DESCRIPTION, '%') <> 0 then
where_str := where_str ||
'and OBJECTS.TYPE_ID in (select TYPES.ID from TYPES ' ||
'where TYPES.DESCRIPTION like '''|| replace(:OBJECTS.TYPE_DESCRIPTION, '''', '''''') ||''')';
else
where_str := where_str ||
'and OBJECTS.TYPE_ID in (select TYPES.ID from TYPES ' ||
'where TYPES.DESCRIPTION='''|| replace(:OBJECTS.TYPE_DESCRIPTION, '''', '''''') ||''')';
end if;
end if;
set_block_property('OBJECTS', default_where, where_str);
end;
http://oracleebsgeeks.blogspot.com/2011/12/querying-on-non-database-field-in.html
你是什麼意思與「所有字段匹配短語」?最終選擇應該如何?如果OPIS_TYPU是非數據庫項目,我只看到KOMENTARZ項目可用。 –
你能提供數據模型嗎? –