Solved

ORACLE FORMS

Posted on 2004-08-25
3
2,163 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
ID: 11894633
send me the fmb on my email (mentioned in my profile - click on my name)
0
 
LVL 8

Expert Comment

by:sapnam
ID: 11900452
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
ID: 11901219
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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

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…
Background In several of the companies I have worked for, I noticed that corporate reporting is off loaded from the production database and done mainly on a clone database which needs to be kept up to date daily by various means, be it a logical…
This video shows setup options and the basic steps and syntax for duplicating (cloning) a database from one instance to another. Examples are given for duplicating to the same machine and to different machines
This video shows how to Export data from an Oracle database using the Original Export Utility.  The corresponding Import utility, which works the same way is referenced, but not demonstrated.

863 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

22 Experts available now in Live!

Get 1:1 Help Now