Solved

ORACLE FORMS

Posted on 2004-08-25
3
2,157 Views
Last Modified: 2011-10-03
There is a form and in that form some patient_id's do not have a assigned_id. But if I go to that table (from where this field comes from) and do a filter on assigned_id is null, then it does not return any records.. So the person who has developed the form has done it is some way that i do not understand.. Can you please help me figure out how to get the  patients that do not have a assigned_id.. Also pl. email ur email so that I can send the fmb file..

SOME BLOOCKS IN THE FORM:
PROCEDURE QUERY_Pat_ASSIGNED_IDS IS
  orig_where varchar2(1000);
BEGIN

  if :assigned_ids.assignee_id is not null
  and :patients.id is null then
     orig_where := get_block_property('patients', DEFAULT_WHERE);
     set_block_property('patients', DEFAULT_WHERE,'where id = '||:assigned_ids.assignee_id);
     go_block('PATIENTS');
     clear_block;
     execute_query;

     set_block_property('patients', DEFAULT_WHERE, orig_where);
  end if;
END;



-- *************************************************************************
-- WARNING: OPENING THIS PROCEDURE IN ANY CALLING FORM'S PL-SQL EDITOR
-- BREAKS THE SUB-CLASSED LINK.
-- *************************************************************************

PROCEDURE ZOOM_ASSIGNED_IDS(assignee_type IN VARCHAR2,
                            assignee_id   IN NUMBER,
                            assigner_type IN VARCHAR2,
                            assigner_id   IN NUMBER,
                            assigned_id   IN VARCHAR2) IS


   version  VARCHAR2(30) := 'zoom_pricing: chg101026';
   p_id     ParamList;

BEGIN
   p_id := Create_Parameter_List('pLIST');

   add_parameter(p_id, 'zoom_assignee_type', TEXT_PARAMETER, assignee_type);
   add_parameter(p_id, 'zoom_assignee_id',   TEXT_PARAMETER, assignee_id);
   add_parameter(p_id, 'zoom_assigner_type', TEXT_PARAMETER, assigner_type);
   add_parameter(p_id, 'zoom_assigner_id',   TEXT_PARAMETER, assigner_id);
   add_parameter(p_id, 'zoom_assigned_id',   TEXT_PARAMETER, assigned_id);

   CALL_FORM('assids', hide, do_replace, no_query_only, p_id);

   Destroy_Parameter_List(p_id);
END;



--set_window_property(FORMS_MDI_WINDOW, window_state, maximize);
set_window_property('pt_window', window_state, maximize);

default_value('N','global.addr_requery');

if :header.zoom_id is not NULL then
   set_block_property('patients', DEFAULT_WHERE, 'where id = '
      || TO_CHAR(:header.zoom_id));
   execute_query;
 
   :header.zoom_id := NULL;
   set_block_property('patients', DEFAULT_WHERE, '');
else
  go_block('ASSIGNED_IDS');
  go_block('ADDRESSES');
  go_block('PHONES');
  go_block('PATIENTS');
end if;

:global.pat_saved := 'N';
check_sec_profiles('pt');




--
-- Begin default relation declare section
--
DECLARE
  Dummy_Define CHAR(1);
  --
  -- Begin ADDRESSES detail declare section
  --
  CURSOR ADDRESSES_cur IS      
    SELECT 1 FROM addresses    
    WHERE NAME_ID = :PATIENTS.ID;
  --
  -- End ADDRESSES detail declare section
  --
  --
  -- Begin ASSIGNED_IDS detail declare section
  --
  CURSOR ASSIGNED_IDS_cur IS      
    SELECT 1 FROM ASSIGNED_IDS    
    WHERE ASSIGNEE_ID = :PATIENTS.ID;
  --
  -- End ASSIGNED_IDS detail declare section
  --
--
-- End default relation declare section
--
--
-- Begin default relation program section
--
BEGIN
  --
  -- Begin ADDRESSES detail program section
  --
  OPEN ADDRESSES_cur;    
  FETCH ADDRESSES_cur INTO Dummy_Define;    
  IF ( ADDRESSES_cur%found ) THEN    
    Message('Cannot delete master record when matching detail records exist.');    
    CLOSE ADDRESSES_cur;    
    RAISE Form_Trigger_Failure;    
  END IF;
  CLOSE ADDRESSES_cur;
  --
  -- End ADDRESSES detail program section
  --
  --
  -- Begin ASSIGNED_IDS detail program section
  --
  OPEN ASSIGNED_IDS_cur;    
  FETCH ASSIGNED_IDS_cur INTO Dummy_Define;    
  IF ( ASSIGNED_IDS_cur%found ) THEN    
    Message('Cannot delete master record when matching detail records exist.');    
    CLOSE ASSIGNED_IDS_cur;    
    RAISE Form_Trigger_Failure;    
  END IF;
  CLOSE ASSIGNED_IDS_cur;
  --
  -- End ASSIGNED_IDS detail program section
  --
END;
--
-- End default relation program section
--



--
-- Begin default relation declare section
--
DECLARE
  recstat     VARCHAR2(20) := :System.record_status;  
  startitm    VARCHAR2(61) := :System.cursor_item;  
  rel_id      Relation;
--
-- End default relation declare section
--
--
-- Begin default relation program section
--
BEGIN
  IF ( recstat = 'NEW' or recstat = 'INSERT' ) THEN  
    RETURN;
  END IF;
  --
  -- Begin ADDRESSES detail program section
  --
  IF ( (:PATIENTS.ID is not null) ) THEN  
    rel_id := Find_Relation('PATIENTS.RELATION_ADDRESSES');  
    Query_Master_Details(rel_id, 'ADDRESSES');  
  END IF;
  --
  -- End ADDRESSES detail program section
  --
  --
  -- Begin ASSIGNED_IDS detail program section
  --
  IF ( (:PATIENTS.ID is not null) ) THEN  
    rel_id := Find_Relation('PATIENTS.RELATION_ASSIGNED_IDS');  
    Query_Master_Details(rel_id, 'ASSIGNED_IDS');  
  END IF;
  --
  -- End ASSIGNED_IDS detail program section
  --

  IF ( :System.cursor_item <> startitm ) THEN    
     Go_Item(startitm);    
     Check_Package_Failure;    
  END IF;
END;
--
-- End default relation program section


zoom_assigned_ids(:assignee_type, :assignee_id, NULL, NULL, NULL);


:global.x_coor := 1 + Get_Item_Property(:SYSTEM.CURRENT_BLOCK ||'.'||:SYSTEM.CURRENT_ITEM,X_POS);
:global.y_coor := 5 + Get_Item_Property(:SYSTEM.CURRENT_BLOCK ||'.'||:SYSTEM.CURRENT_ITEM,Y_POS);

refsource_lu(:assigned_ids.assigner_type, :assigned_ids.assigner_id, :GLOBAL.X_COOR, :GLOBAL.Y_COOR);

0
Comment
Question by:Sara_j_11
  • 2
3 Comments
 
LVL 9

Assisted Solution

by:pratikroy
pratikroy earned 200 total points
Comment Utility
send me the fmb on my email (mentioned in my profile - click on my name)
0
 
LVL 8

Expert Comment

by:sapnam
Comment Utility
So the table has patient_id and assigned id and none of the records have a null assigned id.
Now you say the form does not display assigned id for some patient ids.

In the form, check the block where you are displaying this information.  Is it a block with a base table same as tne table.
Then how do you see a patient record.  Is it by doing Execute Query.

You can send me the fmb on udaym@vsnl.com and also the relevant table structures
0
 
LVL 8

Accepted Solution

by:
sapnam earned 300 total points
Comment Utility
Continuing further, let us check this step by step

1. The form should have a block with Base Table Property as your patients table
2. The block should have 2 fields, one to show the patient id and one the assigned id.  Both fields base table property must be True
3. In execute query, you should be able to see the assigned id for the patient id
0

Featured Post

PRTG Network Monitor: Intuitive Network Monitoring

Network Monitoring is essential to ensure that computer systems and network devices are running. Use PRTG to monitor LANs, servers, websites, applications and devices, bandwidth, virtual environments, remote systems, IoT, and many more. PRTG is easy to set up & use.

Join & Write a Comment

Working with Network Access Control Lists in Oracle 11g (part 1) Part 2: http://www.e-e.com/A_9074.html So, you upgraded to a shiny new 11g database and all of a sudden every program that used UTL_MAIL, UTL_SMTP, UTL_TCP, UTL_HTTP or any oth…
Note: this article covers simple compression. Oracle introduced in version 11g release 2 a new feature called Advanced Compression which is not covered here. General principle of Oracle compression Oracle compression is a way of reducing the d…
This video shows information on the Oracle Data Dictionary, starting with the Oracle documentation, explaining the different types of Data Dictionary views available by group and permissions as well as giving examples on how to retrieve data from th…
This videos aims to give the viewer a basic demonstration of how a user can query current session information by using the SYS_CONTEXT function

772 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

10 Experts available now in Live!

Get 1:1 Help Now