[Webinar] Streamline your web hosting managementRegister Today

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 606
  • Last Modified:

What does this oracle code do?

PROCEDURE scroll_control IS
BEGIN
IF GET_BLOCK_PROPERTY(:SYSTEM.CURSOR_BLOCK,INSERT_ALLOWED) <> 'TRUE' AND GET_BLOCK_PROPERTY(:SYSTEM.CURSOR_BLOCK,UPDATE_ALLOWED) <> 'TRUE' THEN
  IF :SYSTEM.CURSOR_RECORD = 1 AND :SYSTEM.LAST_RECORD = 'TRUE' THEN
        SET_ITEM_PROPERTY('TOOL.FIRST',ENABLED,PROPERTY_FALSE);
        SET_ITEM_PROPERTY('TOOL.PREVIOUS',ENABLED,PROPERTY_FALSE);
        SET_ITEM_PROPERTY('TOOL.NEXT',ENABLED,PROPERTY_FALSE);
        SET_ITEM_PROPERTY('TOOL.LAST',ENABLED,PROPERTY_FALSE);
  ELSIF :SYSTEM.CURSOR_RECORD = 1 AND :SYSTEM.LAST_RECORD <> 'TRUE' THEN
        SET_ITEM_PROPERTY('TOOL.FIRST',ENABLED,PROPERTY_FALSE);
        SET_ITEM_PROPERTY('TOOL.PREVIOUS',ENABLED,PROPERTY_FALSE);
        SET_ITEM_PROPERTY('TOOL.NEXT',ENABLED,PROPERTY_TRUE);
        SET_ITEM_PROPERTY('TOOL.LAST',ENABLED,PROPERTY_TRUE);
  ELSIF :SYSTEM.CURSOR_RECORD <> 1 AND :SYSTEM.LAST_RECORD = 'TRUE' THEN
        SET_ITEM_PROPERTY('TOOL.FIRST',ENABLED,PROPERTY_TRUE);
        SET_ITEM_PROPERTY('TOOL.PREVIOUS',ENABLED,PROPERTY_TRUE);
        SET_ITEM_PROPERTY('TOOL.NEXT',ENABLED,PROPERTY_FALSE);
        SET_ITEM_PROPERTY('TOOL.LAST',ENABLED,PROPERTY_FALSE);
  ELSIF :SYSTEM.CURSOR_RECORD <> 1 AND :SYSTEM.LAST_RECORD <> 'TRUE' THEN
        SET_ITEM_PROPERTY('TOOL.FIRST',ENABLED,PROPERTY_TRUE);
        SET_ITEM_PROPERTY('TOOL.PREVIOUS',ENABLED,PROPERTY_TRUE);
        SET_ITEM_PROPERTY('TOOL.NEXT',ENABLED,PROPERTY_TRUE);
        SET_ITEM_PROPERTY('TOOL.LAST',ENABLED,PROPERTY_TRUE);
  END IF;
ELSE
        SET_ITEM_PROPERTY('TOOL.FIRST',ENABLED,PROPERTY_FALSE);
        SET_ITEM_PROPERTY('TOOL.PREVIOUS',ENABLED,PROPERTY_FALSE);
        SET_ITEM_PROPERTY('TOOL.NEXT',ENABLED,PROPERTY_FALSE);
        SET_ITEM_PROPERTY('TOOL.LAST',ENABLED,PROPERTY_FALSE);
END IF;
END;
0
mc87
Asked:
mc87
2 Solutions
 
Devinder Singh VirdiLead Oracle DBA TeamCommented:
ITs very simple code,
read line by line if you are not allowed to insert/update
Check if you have only one record then do something
Its its in first record but not the last record  do something
if its in last record but not in first  record then do something (that indicate there are many records)
If its somewhere in middle not first, not last do something.
0
 
flow01Commented:
I would guess
  'TOOL.FIRST'
  'TOOL.PREVIOUS'
  'TOOL.NEXT'
  'TOOL.LAST'
are buttons looking like << < > >> to navigate between records and that are disabled/enabled (by your procedure) when such navigation is not possible/possible
0

Featured Post

Never miss a deadline with monday.com

The revolutionary project management tool is here!   Plan visually with a single glance and make sure your projects get done.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now