DELETE_TREE_NODE
Hi allI have a button on my form of the tree, I want to remove the node from the tree of the database and the tree order too.
The following triger works very well...
It removes the node from the tree the tree control
DECLARE
htree ITEM;
top_node ftree.node;
delete_node FTree.node;
delete_value varchar(100);
BEGIN
delete_record;
htree := Find_Item('TREE_BLOCK_TEST.TREE13');
delete_value := :INSP_EQUIPMENT_TYPE.EQUIPMENT_TYPE;
MESSAGE('delete_value'||delete_value);
MESSAGE('delete_value'||delete_value);
delete_node := Ftree.find_tree_node(htree,delete_value,
Ftree.FIND_NEXT,
Ftree.node_label,
Ftree.root_node,
Ftree.root_node);
IF NOT Ftree.ID_NULL(delete_node) THEN
Ftree.delete_tree_node(htree, delete_node);
END IF;
END;
---------------------------------But the following triger does NOT work...
It removes the node from the tree of the DATABASE
whenever I select the tree node, press THE BUTTON DELETE, I created, I got the following error:
-----------------------------------
FRM-40508 FRM-40508: could not insert the record
You try to insert a record into Oracle Forms, but this attempt fails for some reason any.
--------------------------------------
DECLARE
NODE FTREE.NODE;
HTREE ITEM := FIND_ITEM('TREE_BLOCK_TEST.TREE13');
BEGIN
NODE := :SYSTEM.TRIGGER_NODE;
FTREE.DELETE_TREE_NODE(HTREE, NODE);
DELETE FROM INSP_EQUIPMENT_TYPE
WHERE EQUIPMENT_TYPE_D = :EQUIPMENT_TYPE_D;
END;
I got some colleagues here a trigger that returns the lable of the tree in the text box, that I will put the value of the tree of as follows DECLARE
HTREE$ ITEM := Find_Item('TREE_BLOCK_TEST.TREE13');
BEGIN
IF :SYSTEM.TRIGGER_NODE_SELECTED = 'TRUE' THEN
:CONTROL.NODE_NUMBER := :SYSTEM.TRIGGER_NODE;
:INSP_EQUIPMENT_TYPE.EQUIPMENT_TYPE :=
FTREE.GET_TREE_NODE_PROPERTY(HTREE$, :SYSTEM.TRIGGER_NODE, FTREE.NODE_LABEL);
END IF;
END;
This is may be the cause, I can not yet return true pk or id that is stored in the database can someone help me pls.Kind regards
Abdetu...
What is the content of node_value? Contain the pk and nothing else?
If you do
DECLARE
pk INSP_EQUIPMENT_TYPE.EQUIPMENT_TYPE_ID%TYPE;
BEGIN
IF Ftree.Get_Tree_Property('TREE_BLOCK_TEST.TREE13', Ftree.SELECTION_COUNT) = '1' THEN
pk := ftree.get_tree_node_property(
'TREE_BLOCK_TEST.TREE13',
:system.trigger_node,
ftree.node_value);
message('pk: '||pk);
message('pk: '||pk);
DELETE FROM INSP_EQUIPMENT_TYPE
WHERE EQUIPMENT_TYPE_ID = pk;
ELSE
Message('Please select a tree node for deletion.');
Message('Please select a tree node for deletion.');
END IF;
END;
then it should show you.
Tags: Oracle Development
Similar Questions
-
Hello
The following procedure is called from wnfi trigger but no data
and I have no other code to call I'm wrong?
I want 2 fill the tree, but the shape is empty!
PROCEDURE PR_TREE IS
rgTree RECORDGROUP;
vcQuery VARCHAR2 (12000);
nStatus NUMBER;
itTree ITEM: = FIND_ITEM ("BL_TREE.IT_TREE");
BEGIN
rgTree: = FIND_GROUP ("RG_TREE");
-Clear tree
Ftree.DELETE_TREE_NODE (itTree, Ftree.ROOT_NODE);
rgTree: = Create_Group_From_Query ('rgTree',
"Select-1, level, ACCOUNT_NAME, NULL, to_char (ACCOUNT_ID) '.
|' of ' GL_ACCOUNTS |
"connect by prior ACCOUNT_ID = ACCOUNT_ID_SYS_C0011057 ' |
"Start by ACCOUNT_ID_SYS_C0011057 IS NULL.
ORDER BY ACCOUNT_ID');
nStatus: = Populate_Group (rgTree);
Ftree.Set_Tree_Property (itTree, Ftree.RECORD_GROUP, rgTree);
-Repopulating Record-Group
-nStatus: = POPULATE_GROUP (rgTree);
-Repopulating tree
Ftree.POPULATE_TREE (itTree);
END;
-------------------------------------------------------------------------------------------
PLS, help is needed
Kind regards
Abdetu...Are you sure you are using the threshold from which I've added?
FTREE.POPULATE_TREE(itTree);
and check the query if it retrieves results or not?
-Clément
-
Delete items from a tree:
I'm trying to delete items from a tree. I used Ftree.Delete_Tree_Node (htree,: trigger_node);
It deletes the node eventhough that the child exists. I don't want the user to remove an if child node exist.
How we do it.
How we count the childs in a selected parent node.You can search for a child node of the node of your, if it exists, there are children, as
DECLARE nd FTree.NODE; BEGIN nd:= FTREE.FIND_TREE_NODE('THETREE','',FTREE.FIND_NEXT_CHILD, FTREE.NODE_VALUE,:SYSTEM.TRIGGER_NODE,:SYSTEM.TRIGGER_NODE); IF NOT FTree.ID_NULL(nd) THEN -- there are children END IF; END;
Maybe you are looking for
-
Microsoft Mobile Mouse 3000 lock as I am scrolling
original title: Microsoft Mobile Mouse 3000 I have this mouse model 1359 and he became addicted to my desk at work. It doesn't seem to work well at all and was wondering if it the wrong kind of mouse for a desktop computer. It crashes as I am scrolli
-
Pavilion g6 1221et win 7 32 bit driver
Hello world. When I bought pavilion laptop 1221et g6, it came with win7 home basic initial license. But ı formatted my pc and could not find win7 32 bit drivers on the hp website. Can someone find me win7 32-bit drivers for my laptop Pls?
-
I'm running mse how to stop a program at startup to the top
How do I change start programs when running microsoft security essentials, Use windows defender, but understand that this is blocked during execution of mse. also my pc is very slow the beginning upward since installing mse, is this normal?
-
Do right click on the mouse does not.
Bought a new computer with windows 7 pre-installed touchscreen and the latest internet explore. The "right-click" wireless mouse doesn't work at all on the desktop or start menu Explorer etc. Is - this mouse does not, or something else. I connected a
-
I changed my picture of account, he has changed the background, I don't like the change, that is editable? I don't see an option "change the background of account '?