11.01.2013 Views

Oracle Forms Developer – Form Builder Reference, Volume 1

Oracle Forms Developer – Form Builder Reference, Volume 1

Oracle Forms Developer – Form Builder Reference, Volume 1

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

420<br />

QUERY_TEXT Replaces the data set of the<br />

hierarchical tree with an SQL query and causes it to<br />

display.<br />

ALLOW_EMPTY_BRANCHES Possible values are<br />

PROPERTY_TRUE and PROPERTY_FALSE.<br />

value Specify the value appropriate to the property you are<br />

setting:<br />

PROPERTY_TRUE The property is to be set to the<br />

TRUE state.<br />

PROPERTY_FALSE The property is to be set to the<br />

FALSE state.<br />

SET_TREE_PROPERTY examples<br />

/*<br />

** Built-in: SET_TREE_PROPERTY<br />

*/<br />

-- This code could be used in a WHEN-NEW-FORM-INSTANCE<br />

-- trigger to initially populate the hierarchical tree<br />

-- with data.<br />

DECLARE<br />

htree ITEM;<br />

v_ignore NUMBER;<br />

rg_emps RECORDGROUP;<br />

BEGIN<br />

-- Find the tree itself.<br />

htree := Find_Item(’tree_block.htree3’);<br />

-- Check for the existence of the record group.<br />

rg_emps := Find_Group(’emps’);<br />

IF NOT Id_Null(rg_emps) THEN<br />

DELETE_GROUP(rg_emps);<br />

END IF;<br />

-- Create the record group.<br />

rg_emps := Create_Group_From_Query(’rg_emps’,<br />

’select 1, level, ename, NULL, to_char(empno) ’ ||<br />

’from emp ’ ||<br />

’connect by prior empno = mgr ’ ||<br />

’start with job = ’’PRESIDENT’’’);<br />

-- Populate the record group with data.<br />

v_ignore := Populate_Group(rg_emps);<br />

-- Transfer the data from the record group to the<br />

hierarchical

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!