Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

ORACLE FORMS

Posted on 2004-08-25
3
Medium Priority
?
2,224 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
3 Comments
 
LVL 9

Assisted Solution

by:pratikroy
pratikroy earned 600 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 900 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

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

Truncate is a DDL Command where as Delete is a DML Command. Both will delete data from table, but what is the difference between these below statements truncate table <table_name> ?? delete from <table_name> ?? The first command cannot be …
I remember the day when someone asked me to create a user for an application developement. The user should be able to create views and materialized views and, so, I used the following syntax: (CODE) This way, I guessed, I would ensure that use…
This video shows, step by step, how to configure Oracle Heterogeneous Services via the Generic Gateway Agent in order to make a connection from an Oracle session and access a remote SQL Server database table.
This video explains what a user managed backup is and shows how to take one, providing a couple of simple example scripts.

715 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