-- Database dynamic if for your question : condition saved in table.column -> 'var1 = 1 ' create or replace FUNCTION my_condition ( p_if_stmt in varchar2, P_value in Number) return BOOLEAN is v_ifstmt VARCHAR2(220); v_result NUMBER := NULL; v_ret BOOLEAN := FALSE; BEGIN -- i.E. substitue expression before the equal-sign with p_value, Known in the Formsrecord -- substr('B1.item1 = 1',instr('B1.item1 = 1','='), length( 'B1.item1 = 1')) v_ifstmt := to_char(P_value)||' ' ||substr(p_if_stmt,instr(p_if_stmt,'='), length( p_if_stmt)); v_ifstmt := 'select 1 from dual where '||v_ifstmt ; -- dbms_output.put_line('IFSTMT=' ||v_ifstmt); EXECUTE IMMEDIATE v_ifstmt INTO v_result ; -- When a record is found, by select from dual, theCondition is True -- ELSE an EXCEPTION IS RAISED (NO_DATA_FOUND)) v_ret := TRUE; return V_RET; Exception WHEN NO_DATA_FOUND THEN return FALSE; WHEN OTHERS THEN -- how to handle OTHER ERRORS RAISE; END; --- TESTCASEs for -- FUNCTION my_condition ( p_if_stmt in varchar2, P_value in Number) return BOOLEAN -- declare erg BOOLEAN; begin -- RETURN FALSE erg := my_condition ('Block1.item1 = 1', 2); IF erg THEN dbms_output.put_line('Condition TRUE'); ELSE dbms_output.put_line('Condition FALSE'); END IF; -- RETURN TRUE erg := my_condition ('Block1.item1 = 1', 1); IF erg THEN dbms_output.put_line('Condition TRUE'); ELSE dbms_output.put_line('Condition FALSE'); END IF; -- RAISE ERROR Begin erg := my_condition ('Block1.item1 xx 1', 1); IF erg THEN dbms_output.put_line('Condition TRUE'); ELSE dbms_output.put_line('Condition FALSE'); END IF; exception when others then dbms_output.put_line('ERROR ORA '||SQLCODE||': '||SQLERRM); end; end; ########################################## EXAMPLE 2 ########################################## --- FORMS dynamic if for your question : condition saved in table.column -> 'var1 = 1 ' PACKAGE cond_by_group IS PROCEDURE prc_cr_group; FUNCTION forms_condition ( p_if_stmt in varchar2, P_value in Number) return BOOLEAN; END; PACKAGE BODY cond_by_group IS rg_name VARCHAR2(40) := 'CHECKCONDITION'; rg_id RecordGroup; gc_id GroupColumn; -- Create_Group i.E in when new form-instance-trigger -- cond_by_group.prc_cr_group; PROCEDURE prc_cr_group IS BEGIN /* ** Make sure the record group does not already exist.*/ rg_id := Find_Group(rg_name); /* ** If it does not exist, create it and add the two ** necessary columns to it. */ IF Id_Null(rg_id) THEN rg_id := Create_Group(rg_name); /* Add a number columns to the record group */ gc_id := Add_Group_Column(rg_id, 'IFCOND', NUMBER_COLUMN); END IF; end; -- check condition to use in post-query in your case FUNCTION forms_condition ( p_if_stmt in varchar2, P_value in Number) return BOOLEAN IS v_ifstmt VARCHAR2(220); the_rowcount NUMBER; errcode NUMBER; BEGIN -- i.E. substitue expression before the equal-sign with p_value, Known in the Formsrecord -- substr('B1.item1 = 1',instr('B1.item1 = 1','='), length( 'B1.item1 = 1')) v_ifstmt := to_char(P_value)||' ' ||substr(p_if_stmt,instr(p_if_stmt,'='), length( p_if_stmt)); v_ifstmt := 'select 1 from dual where '||v_ifstmt ; errcode := Populate_Group_With_Query( rg_id, v_ifstmt ); the_rowcount := GET_GROUP_ROW_COUNT(rg_id); if NVL(the_rowcount,0) >0 THEN return true; else return false; END IF; END; END;