Master and Detail records in the same table

Hi Steve,
I have master and detail address records in the same table (self-reference). The master addresses are used as templates for detail addresses. Master addresses do not have any masters. Detail addresses have three masters: a master address, a calendar reference and a department. Addresses change from time to time and every department has its own email-account, but they refer to the same master to pre-fill some common values.
Now I need to edit the master and detail address records on the same web page simultaneously.
My question is: Can I implement a Master-View and Detail-View which refer to the same Entity-Object? Or should I implement a second Entity-Object? Or can it be done in a single Master-Detail-View?
Thanks a lot.
Kai.

At a high level, wouldn't this be similar to an Emp entity based on the familiar EMP table that has an association from Emp to itself for the Emp.Mgr attribute?
You can definitely build a view object that references two entity usages of the same entity like this to show, say, an employee's ENAME and at the same time their manager's ENAME.
If there are multiple details for a given master, you can also do that with separate VO's both based on the same entity, sure. Again, just like a VO that shows a manager, and a view-linked VO of all the employees that report to him/her.

Similar Messages

  • Show master and detail viewobjects in the same jsp

    I have two viewobjects which have a master-detail relationship (a viewlink between them).
    What I want to do is to show both the master and the detail data in the same jsp, i.e for every row in the master viewobject I want to show all the rows in the detail viewobject.
    I tried to drop the master vo on the page from the component palette and then the detail vo next to the master vo, but then only the first row in the detail vo is shown on the page. I want all of them to be shown.
    Can anyone please point me in the right direction here?
    Ps: I'm using JDeveloper version 9.0.5.2
    Thanx a lot
    Tom

    I dropped both viewobjects as read-only tables and they both have the rangesize set to -1.
    I think I made myself a bit unclear when asking my question. I do not want a "normal" master-detail view in my jsp where you see one masterrow and all the detailrows. I want my page to show all the masterrows with all their corresponding detail rows listed under the master row.
    The pseudocode may look like this:
    for each row in MasterViewObject loop
    <<display data in MasterViewObject>>
    for each row in DetailViewObject loop
    <<display data in DetailViewObject>>
    end inner loop
    end outer loop
    As you see I have a double loop here. Is somehing like this possible without "manually" doing all the stuff?
    Thanx
    Tom

  • Go to detail page and update record at the same time

    Hi guys,
    I`m very new to dreamweaver and have no coding skills, so
    please be gentle.
    I`m have created a mail box and it all works fine, the
    problem i`m having is that I want to be able to tag wether a
    message has been read or not.
    So the subject has to be a link so when someone clicks the
    subject you are redirected to the read message page and it displays
    the message in full.
    My question is there a way to go to detail page and update
    record at the same time?
    I`m using ASP and the mysql read or not field is a SET

    "mrmidjam" <[email protected]> wrote in
    message
    news:fghrpf$7s2$[email protected]..
    > Hi guys,
    >
    > I`m very new to dreamweaver and have no coding skills,
    so please be
    > gentle.
    >
    > I`m have created a mail box and it all works fine, the
    problem i`m having
    > is
    > that I want to be able to tag wether a message has been
    read or not.
    >
    > So the subject has to be a link so when someone clicks
    the subject you are
    > redirected to the read message page and it displays the
    message in full.
    >
    > My question is there a way to go to detail page and
    update record at the
    > same
    > time?
    You can use the Update Record ZerverBehavrior and then have
    it redirect to
    the detailpage.
    Joris

  • Duplicate records in the same table

    Hello.
    I want to duplicate records in the same table, changing just two date fields and id. Id is changed with sequence.
    Example:
    id name start_date end_date
    1 record_1 01.01.04 31.12.04
    2 record_2 01.01.03 31.12.03
    I want to duplicate record with the start_date year 04 and the duplicated record would change that start_date into year 05.
    After duplicate it should look like:
    1 record_1 01.01.04 31.12.04
    2 record_2 01.01.03 31.12.03
    3 record_1 01.01.05 31.12.05
    How should my insert look like?
    Thanks

    create sequence A_SEQ
       start with 3
       nocache
    insert into tableA
            (ID, name, start_date end_date)
       select
               A_SEQ.nextval   
              ,NAME
              ,start_date + add_months (12)
              ,end_date   + add_months (12)
         from
               tableA
        where
               start_date >= to_date('01.01.2004','dd.mm.yyyy')
          and  start_date <= to_date('01.01.2004','dd.mm.yyyy')

  • Calculating average time from two records from the same table.

    Hi all
    I need to calculate the average time between two events that are recorded in the same table.
    The table is TMS_MESSAGE_AUDIT_LOG
    MESSAGE_ID VARCHAR2(16 BYTE) NOT NULL,
    MESSAGE_VERSION NUMBER(2) NOT NULL,
    CREATE_TM VARCHAR2(18 BYTE) NOT NULL,
    MESSAGE_STATUS VARCHAR2(30 BYTE),
    TRANSACTION_TYPE_NM VARCHAR2(30 BYTE),
    MESSAGE_TP VARCHAR2(3 BYTE),
    WORKFLOW_OBJECT VARCHAR2(30 BYTE) NOT NULL,
    WORKFLOW_REQUEST VARCHAR2(30 BYTE) NOT NULL,
    WORKFLOW_RETURN_CD VARCHAR2(30 BYTE) NOT NULL,
    AUDIT_ACTION VARCHAR2(255 BYTE),
    LAST_UPDATE_USER_LOGON_ID VARCHAR2(12 BYTE),
    LOCAL_TM VARCHAR2(18 BYTE) NOT NULL,
    LOCAL_TIME_ZN_NM VARCHAR2(70 BYTE) NOT NULL,
    LOCAL_DAYLIGHT_IN CHAR(1 BYTE) NOT NULL,
    FPRINT VARCHAR2(30 BYTE)
    What i now need is
    When the MESSAGE_ID is the same i need have the average time between when the MESSAGE_STATUS is AA and BB ( I need the time out of the CREATE_TM field )
    And this for every 15 minutes interval.
    Because this table will become BIG millions and millions of records it needs to be fast.
    Can anybody help me.
    Marcel

    Something like this?
    CREATE TABLE wr_test
    ( message_id                 VARCHAR2(16 BYTE) NOT NULL
    , message_version            NUMBER(2) NOT NULL  -- Assumption: Acknowledged ver > Received ver
    , create_tm                  VARCHAR2(18 BYTE) NOT NULL
    , message_status             VARCHAR2(30 BYTE)
    , transaction_type_nm        VARCHAR2(30 BYTE)
    , workflow_object            VARCHAR2(30 BYTE) DEFAULT 'x' NOT NULL
    , workflow_request           VARCHAR2(30 BYTE) DEFAULT 'x' NOT NULL
    , workflow_return_cd         VARCHAR2(30 BYTE) DEFAULT 'x' NOT NULL
    , audit_action               VARCHAR2(255 BYTE)
    , last_update_user_logon_id  VARCHAR2(12 BYTE)
    , local_tm                   VARCHAR2(18 BYTE) NOT NULL
    , local_time_zn_nm           VARCHAR2(70 BYTE) DEFAULT 'GMT' NOT NULL
    , local_daylight_in          CHAR(1 BYTE) DEFAULT 'x' NOT NULL );
    INSERT ALL
    INTO   wr_test
           ( message_id
           , message_version
           , create_tm
           , message_status
           , local_tm )
    VALUES ( message_id
           , 1
           , create_tm
           , '(Receive)'
           , TO_CHAR(local_tm,'YYYYMMDD HH24:MI:SS') )
    INTO   wr_test
           ( message_id
           , message_version
           , create_tm
           , message_status
           , local_tm )
    VALUES ( message_id
           , 2
           , create_tm
           , 'Wait CLSB Ack'
         , TO_CHAR
           ( local_tm + NUMTODSINTERVAL(DBMS_RANDOM.VALUE(0,2e5),'SECOND')
           , 'YYYYMMDD HH24:MI:SS' ) )
    SELECT ROWNUM AS message_id
         , TO_CHAR(SYSDATE,'YYYYMMDD HH24:MI:SS') AS create_tm
         , DATE '2000-01-01' + DBMS_RANDOM.VALUE(0,3) AS local_tm
    FROM dual CONNECT BY ROWNUM < 100000;
    WITH src AS
         ( SELECT message_id
                , message_status
                , message_version
                , TO_DATE(SUBSTR(local_tm,1,17),'YYYYMMDD HH24:MI:SS') AS dt
                , TO_DATE(SUBSTR(local_tm,1,8),'YYYYMMDD') AS dt_day
                , TO_CHAR(TO_DATE(SUBSTR(local_tm,10,8),'HH24:MI:SS'),'SSSSS') AS dt_sec
           FROM   wr_test
           WHERE  message_status IN ('(Receive)','Wait CLSB Ack') )
    SELECT dt_day + NUMTODSINTERVAL(period,'SECOND') AS dt
         , NUMTODSINTERVAL(AVG(elapsed),'DAY') AS avg_elapsed
         , NUMTODSINTERVAL(MIN(elapsed),'DAY') AS min_elapsed
         , NUMTODSINTERVAL(MAX(elapsed),'DAY') AS max_elapsed
         , COUNT(*)
    FROM   ( SELECT message_id
                  , message_status
                  , dt_day
                  , TRUNC(dt_sec/300)*300 AS period
                  , LEAD(dt) OVER (PARTITION BY message_id ORDER BY message_version) AS ack_dt
                  , LEAD(dt) OVER (PARTITION BY message_id ORDER BY message_version) - dt AS elapsed
             FROM   src ) cal
    WHERE  cal.message_status = '(Receive)'
    GROUP BY dt_day, period
    ORDER BY 1;Replace "wr_test" with "tms_message_audit_log" in the WITH subquery to test on your data.

  • Nsert/Update and Add Column at the same Table and at the "same" Time

    Hello,
    I want Insert/Update and Add Column at the same Table and at the "same" Time but in different sessions.
    Example:
    At first the "insert/update" statement:
    Insert into TestTable (Testid,Value) values (1,5105);
    After that the "add" statement:
    Alter table TestTable add TestColumn number;
    - sadly now I get the message: ORA-00054: resource busy and acquire with NOWAIT specified
    "insert/update" statement:
    Insert into TestTable (Testid,Value) values (2,1135);
    After that the execute commit.
    I don't know when the first session set the commit statement so I want that the DB the "Alter Table..." statement execute if it's possible.
    If it's possible I want to save a repeat loop with the "Alter Table..." statemtent.
    Thanks for ideas

    Well I want to walk in the rain without and umbrella and still stay dry, but it ain't gonna happen.
    You can't run a DDL statement against a table with transactions pending. Session 2 has to wait until session commits or rollbacks (or until the session is killed). That's just the way it is.
    This makes sense if you think about it. The data dictionary has to be consistent across all sessions. If session 2 was allowed to change the table structure whilst session 1 has a pending transaction then the database is in an inconsistent state. This is easier to see if you consider the reverse situation - the ALTER TABLE statement run by session 2 does a DROP COLUMN TESTID rather than adding a column: now what should happen to session 1's INSERT statement? You have retrospectively invalidated a statement that was perfectly legal when it was executed.
    If it's possible I want to save a repeat loop with the "Alter Table..." statemtent.Fnord.
    Cheers, APC

  • Displaying the master and detail records ....

    Hi ,
    There is a master - detail form. The end-user make some insertions/updates in the detail block...
    How is it possible to display these detail records and its master when the user presses a custom button 'refresh' which just requery the records in both master and detail blocks...?????
    When i write "to display these detail records and its master " i mean that the current record (the one which the cursor would be focused in ) would be this master record... however,all other records would be displayed as well....
    Many thanks,
    Simon

    From what I understand you want to re-query and go to the record where you were just before re-querying??
    Interesting requirement, why you wanna do this? if for the user to see the changes of the updates, that is the default behavior.
    You can do this in two ways.
    1- in your "Refresh" button save the :system.trigger_record in a parameter :parameter.record_num, for the Master block and after the query you do a go_record(:parameter.record_num) .
    BEGIN
         GO_BLOCK('EMP'); --Master Block
         :PARAMETER.RECORD_NUM := :SYSTEM.TRIGGER_RECORD;
         EXECUTE_QUERY;
         GO_RECORD(:PARAMETER.RECORD_NUM);
    END;2 you can loop through the block with next_record built-in and an exit condition of a key value you saved in a parameter.
    BEGIN
         GO_BLOCK('EMP'); --Master Block
         :PARAMETER.EMPNO := :EMP.EMPNO;
         EXECUTE_QUERY;
         FIRST_RECORD;
         LOOP
              EXIT WHEN :EMP.EMPNO = :PARAMETER.EMPNO;
              NEXT_RECORD;
         END LOOP;
    END;Tony

  • Historical and transaction data in the same tables creates perf problems

    Our Oracle based application is slow partly due to the fact that historical data are kept in the same table as transactional data. For example records about deceased patients, patients treated 5 years ago...etc, are kept in the one and only one patient table, which is needed to run the daily process of the hospital. So gradually all our major tables PATIENTS, CHARTS, NAMES, APPOINTMENTS have grown very large and since most of our SQL join all these tables at the same time, then all screens and reports run very slowly. I have introduced the idea that we should split all these tables in two: historical PATIENTS data, and CURRENT PATIENTS data...the same with all the others. A nice system would first search in the smaller transactional tables, which would run faster being smaller, and if no data found, then fallback to the historical tables. But this would require programming. From what I have read mateialized view could solve part of our problem. We could have views containing for example only one year worth of the data, and I guess any changes could be later replicated in the base table. What I dont know is what to do if we cannot find the patient in the matealized views ? Do I need to fallback to another SQL which will search in the initial base tables ? Anyway we can implement this without programming ? Tx.

    Appointment table: 207,470
    Visit table: 5,890,920
    Patient table: 2,993,129
    Chart table: 2,864,069
    Patient names table: 3,938,118
    SELECT
        APPOI_OR_VISIT,
        VISIT_SEQ,
        PAT_SEQ,
        INST_CODE,
        INST_CODE_DISPL,
        INST_DESC,
        CLINIC_CODE,
        CLINIC_CODE_DISPL,
        CLINIC_DESC,
        SPEC_CODE,
        SPEC_CODE_DISPL,
        SPEC_DESC,
        VISIT_DATE,
        VISIT_TIME,
        VISIT_TIME_ARRIVAL,
        APPTYPE_CODE,
        SESSION_DOM_MODE,
        PRESTYPE_CODE,
        PRESTYPE_DOM_TYPE,
        DIA_CODE,
        VISIT_TIME_START_RESP,
        VISIT_TIME_DISCHARGE,
        APPOI_NB_DURATION,
        VISIT_TX_REASON,
        VISIT_TX_COMMENT,
        EXTDOC_CODE,
        VISIT_PN_REFPHYS_NAME,
        PATYPE_CODE,
        PAYRESP_CODE,
        VISIT_IND_GROUP,
        VISIT_PCODE,
        VISIT_IND_COMPLETE,
        VISIT_IND_ADMISSION,
        VISIT_IND_CONFIDENTIALITY,
        VISIT_DATE_ACCIDENT,
        APPOI_SEQ,
        BILLING_CODE,
        VISIT_TX_DIAGNOSIS,
        CST_CODE_1,
        CST_CODE_2,
        CST_CODE_3,
        APPOI_DH_CRE,
        APPOI_CODE_CRE_USER,
        APPOI_DH_MOD,
        APPOI_CODE_MOD_USER,
        VISIT_CODE_CRE_USER,
        VISIT_DH_CRE,
        VISIT_UPDATED_COUNT,
        VISIT_CODE_MOD_USER,
        VISIT_DH_MOD,
        APPOI_PAYRESP_CODE,
        APPOI_DT_ACCIDENT,
        PATIENT_LAST_NAME,
        PATIENT_FIRST_NAME,
        PATIENT_CONFIDENTIALITY,
        PATIENT_CHART_EXT,
        TO_NUMBER(SUBSTR(PATIENT_CHART_EXT, 1, INSTR(PATIENT_CHART_EXT, '|')-1)) AS PATIENT_CHART_NO,
        PAT_IND_SPECIAL_RISK
    FROM
        SELECT
            'VISIT'              AS APPOI_OR_VISIT,
            VISIT.VISIT_SEQ,
            VISIT.PAT_SEQ,
            INSTITUTION.INST_CODE,
            INSTITUTION.INST_CODE_DISPL,
            INSTITUTION.INST_DESC,
            CLINIC.CLINIC_CODE,
            CLINIC.CLINIC_CODE_DISPL,
            CLINIC.CLINIC_DESC,
            SPECIALTY.SPEC_CODE,
            SPECIALTY.SPEC_CODE_DISPL,
            SPECIALTY.SPEC_DESC,
            VISIT.VISIT_DATE,
            VISIT.VISIT_TIME,
            VISIT.VISIT_TIME_ARRIVAL,
            VISIT.APPTYPE_CODE,
            VISIT.SESSION_DOM_MODE,
            VISIT.PRESTYPE_CODE,
            VISIT.PRESTYPE_DOM_TYPE,
            VISIT.DIA_CODE,
            VISIT.VISIT_TIME_START_RESP,
            VISIT.VISIT_TIME_DISCHARGE,
            VISIT.APPOI_NB_DURATION,
            VISIT.VISIT_TX_REASON,
            VISIT.VISIT_TX_COMMENT,
            VISIT.EXTDOC_CODE,
            VISIT.VISIT_PN_REFPHYS_NAME,
            VISIT.PATYPE_CODE,
            VISIT.PAYRESP_CODE,
            VISIT.VISIT_IND_GROUP,
            VISIT.VISIT_PCODE,
            VISIT.VISIT_IND_COMPLETE,
            VISIT.VISIT_IND_ADMISSION,
            VISIT.VISIT_IND_CONFIDENTIALITY,
            VISIT.VISIT_DATE_ACCIDENT,
            VISIT.APPOI_SEQ,
            VISIT.BILLING_CODE,
            VISIT.VISIT_TX_DIAGNOSIS,
            VISIT.CST_CODE_1,
            VISIT.CST_CODE_2,
            VISIT.CST_CODE_3,
            VISIT.APPOI_DH_CRE,
            VISIT.APPOI_CODE_CRE_USER,
            VISIT.APPOI_DH_MOD,
            VISIT.APPOI_CODE_MOD_USER,
            VISIT.VISIT_CODE_CRE_USER,
            VISIT.VISIT_DH_CRE,
            VISIT.VISIT_UPDATED_COUNT,
            VISIT.VISIT_CODE_MOD_USER,
            VISIT.VISIT_DH_MOD,
            NULL AS APPOI_PAYRESP_CODE,
            TO_DATE(NULL) AS APPOI_DT_ACCIDENT,
            NAME.NAM_PN_NAM AS PATIENT_LAST_NAME,
            NAME.NAM_PN_FNAM AS PATIENT_FIRST_NAME,
            CONFIDENTIALITY.CONF_DESC AS PATIENT_CONFIDENTIALITY,
            PI_SECURITY.F_GET_CHART_NUMBER_SCAN_CODE(VISIT.PAT_SEQ, 103 /*:pChartInstitutionID*/, 0) AS PATIENT_CHART_EXT,
            PATIENT.PAT_IND_SPECIAL_RISK
        FROM
                   AS_T_VISITS        VISIT,
                   CT_R_INSTITUTIONS  INSTITUTION,
                   AS_T_CLINICS       CLINIC,
                   CT_R_SPECIALITIES  SPECIALTY,
                   PI_T_NAMES         NAME,
                   PI_T_PATIENTS      PATIENT,
                   PI_R_CONF_LEVELS   CONFIDENTIALITY
        WHERE
            VISIT_DATE >= TO_DATE('2004-04-01', 'YYYY-MM-DD') /*:P_VISIT_DATE_FROM*/ AND
            VISIT_DATE <= TO_DATE('2004-04-02', 'YYYY-MM-DD') /*::P_VISIT_DATE_TO*/ AND
            CLINIC.CLINIC_CODE = VISIT.CLINIC_CODE AND
            SPECIALTY.SPEC_CODE = CLINIC.SPEC_CODE AND
            INSTITUTION.INST_CODE(+) = VISIT.INST_CODE AND
            NAME.PAT_SEQ = VISIT.PAT_SEQ AND
            NAME.NAMTYP_CODE = 1 AND
            PATIENT.PAT_SEQ = VISIT.PAT_SEQ AND
            CONFIDENTIALITY.CONF_CODE (+) = PATIENT.CONF_CODE
        UNION
        SELECT
            'APPOI'                                                                                                                                                                                                        AS APPOI_OR_VISIT,
            0                                                                                                                                                                                                                            AS VISIT_SEQ,
            NVL(APPOINTMENT_GROUP.PAT_SEQ, APPOINTMENT.PAT_SEQ) AS PAT_SEQ,
            INSTITUTION.INST_CODE,
            INSTITUTION.INST_CODE_DISPL,
            INSTITUTION.INST_DESC,
            CLINIC.CLINIC_CODE,
            CLINIC.CLINIC_CODE_DISPL,
            CLINIC.CLINIC_DESC,
            SPECIALTY.SPEC_CODE,
            SPECIALTY.SPEC_CODE_DISPL,
            SPECIALTY.SPEC_DESC,
            APPOINTMENT.SESSION_DATE                                                                                                                                                                AS VISIT_DATE,
            APPOINTMENT.APPOI_TIME                                                                                                                                                                     AS VISIT_TIME,
            ''                                                                                                                                                                                                                  AS VISIT_TIME_ARRIVAL,
            APPOINTMENT.APPTYPE_CODE,
            APPOINTMENT.SESSION_DOM_MODE,
            0                                                                                                                                                                                                                            AS PRESTYPE_CODE,
            ''                                                                                                                                                                                                                  AS PRESTYPE_DOM_TYPE,
            0                                                                                                                                                                                                                            AS DIA_CODE,
            ''                                                                                                                                                                                                                  AS VISIT_TIME_START_RESP,
            ''                                                                                                                                                                                                                  AS VISIT_TIME_DISCHARGE,
            APPOINTMENT.APPOI_NB_DURATION,
            APPOINTMENT.APPOI_TX_REASON                                                                                                                                                           AS VISIT_TX_REASON,
            APPOINTMENT.APPOI_TX_COMMENT                                                                                                                                                      AS VISIT_TX_COMMENT,
            APPOINTMENT.EXTDOC_CODE,
            APPOINTMENT.APPOI_PN_REFPHYS_NAME                                                                                                                                            AS VISIT_PN_REFPHYS_NAME,
            APPOINTMENT_TYPE.PATYPE_CODE  AS PATYPE_CODE,
            0                                                                                                                                                                                                                            AS PAYRESP_CODE,
            DECODE(APPOINTMENT_GROUP.PAT_SEQ,NULL,0,1)                                                                                                                   AS VISIT_IND_GROUP,
            ''                                                                                                                                                                                                                  AS VISIT_PCODE,
            0                                                                                                                                                                                                                            AS VISIT_IND_COMPLETE,
            0                                                                                                                                                                                                                            AS VISIT_IND_ADMISSION,
            APPOINTMENT.APPOI_IND_CONFIDENTIALITY                                                                                                                                  AS VISIT_IND_CONFIDENTIALITY,
            TO_DATE(NULL)                                                                                                                                                                                          AS VISIT_DATE_ACCIDENT,
            APPOINTMENT.APPOI_SEQ,
            0                                                                                                                                                                                                                            AS BILLING_CODE,
            ''                                                                                                                                                                                                                  AS VISIT_TX_DIAGNOSIS,
            0                                                                                                                                                                                                                            AS CST_CODE_1,
            0                                                                                                                                                                                                                            AS CST_CODE_2,
            0                                                                                                                                                                                                                            AS CST_CODE_3,
            APPOINTMENT.APPOI_DH_CRE                                                                                                                                                                AS APPOI_DH_CRE,
            APPOINTMENT.APPOI_CODE_CRE_USER                                                                                                                                                 AS APPOI_CODE_CRE_USER,
            APPOINTMENT.APPOI_DH_MOD                                                                                                                                                                AS APPOI_DH_MOD,
            APPOINTMENT.APPOI_CODE_MOD_USER                                                                                                                                                 AS APPOI_CODE_MOD_USER,
            ''                                                                                                                                                                                                                  AS VISIT_CODE_CRE_USER,
            SYSDATE                                                                                                                                                                                                             AS VISIT_DH_CRE,
            0                                                                                                                                                                                                                            AS VISIT_UPDATED_COUNT,
            ''                                                                                                                                                                                                                  AS VISIT_CODE_MOD_USER,
            SYSDATE                                                                                                                                                                                                             AS VISIT_DH_MOD,
            PAYRESP_CODE                                                                             AS APPOI_PAYRESP_CODE,
            APPOI_DT_ACCIDENT,
            NAME.NAM_PN_NAM AS PATIENT_LAST_NAME,
            NAME.NAM_PN_FNAM AS PATIENT_FIRST_NAME,
            CONFIDENTIALITY.CONF_DESC AS PATIENT_CONFIDENTIALITY,
                                        PI_SECURITY.F_GET_CHART_NUMBER_SCAN_CODE(APPOINTMENT.PAT_SEQ, 103 /*:pChartInstitutionID*/, 0) AS PATIENT_CHART_EXT,
            PATIENT.PAT_IND_SPECIAL_RISK
        FROM
                   AS_T_APPOINTMENTS       APPOINTMENT,
                   AS_R_APPOINTMENT_TYPES  APPOINTMENT_TYPE,
                   AS_T_CLINICS            CLINIC,
                   CT_R_SPECIALITIES       SPECIALTY,
                   CT_R_INSTITUTIONS       INSTITUTION,
                   AS_T_APPOINTMENT_GROUPS APPOINTMENT_GROUP,
                   PI_T_PATIENTS           PATIENT,
                   PI_R_CONF_LEVELS        CONFIDENTIALITY,
                   PI_T_NAMES              NAME,
                   AS_T_APPOINTMENT_SEQ_MAPPING  SEQMAP
        WHERE
            SESSION_DATE >= TO_DATE('2004-04-01', 'YYYY-MM-DD') /*:P_VISIT_DATE_FROM*/ AND
            SESSION_DATE <= TO_DATE('2004-04-02', 'YYYY-MM-DD') /*::P_VISIT_DATE_TO*/ AND
            APPOINTMENT.APPOI_DOM_TYPE IN('A','AR') AND
            CLINIC.CLINIC_CODE = APPOINTMENT.CLINIC_CODE AND
            SPECIALTY.SPEC_CODE = CLINIC.SPEC_CODE AND
            INSTITUTION.INST_CODE(+) = APPOINTMENT.INST_CODE AND
            APPOINTMENT_GROUP.APPOI_SEQ (+) = APPOINTMENT.APPOI_SEQ AND
            APPOINTMENT_TYPE.APPTYPE_CODE (+) = APPOINTMENT.APPTYPE_CODE AND
            NAME.PAT_SEQ = NVL(APPOINTMENT.PAT_SEQ, APPOINTMENT_GROUP.PAT_SEQ) AND
            NAME.NAMTYP_CODE = 1 AND
            PATIENT.PAT_SEQ = NVL(APPOINTMENT.PAT_SEQ, APPOINTMENT_GROUP.PAT_SEQ) AND
            CONFIDENTIALITY.CONF_CODE (+) = PATIENT.CONF_CODE AND
            SEQMAP.APPOI_SEQ (+) = APPOINTMENT.APPOI_SEQ AND
            SEQMAP.APPOI_SEQ IS NULL
    ORDER BY
         VISIT_DATE, VISIT_TIME, PATIENT_CHART_NO

  • Line item and header records in the same infopackage

    Gurus,
    I wanted to check how can I make sure that I get all the line item documents in the same package with the header document record in the same infopackage? Is there some setting for that? If I am writing a custom extractore how can I make sure of this in ABAP?
    Thanks
    AK

    Dear AKBW,
    This is not very clear why you want to use same infopackage for line-item as well as header data. Normally there are 2 different datasources for line item and for header data.
    Say you are woking with Sales Order Data in ECC.
    So Line-item datasource for sales order data - 2LIS_11_VAITM
    and Header datasource for sales order data - 2LIS_11_VAHDR.
    Now as they are 2 different datasource, so you must need 2 different infopackages.
    Now if you have created one custom datasource in ECC, then just check if its extracting line-item level or header level data. Normally when we create any custom datasource, we try to make it line-item level, to have all the itemwise detail. Though its not mandatory.
    So if you have 2 different datasources (SAP or Custom), you definitely need 2 different infopackages.
    Please let me know, if you still have any more doubt. You can also give me the other detail of the custom datsource you are creating.( type, fields, what it is supposed to extract etc)..

  • File name and Measuremen​t in the same table?

    Hi,
    I have written the following VI that opens up each image file from a folder and measures a certain dimension on the image. It then puts the result of the measurement in a table.
    The table has one column and N rows since I have N images in my folder. How can I modify this VI so that it puts the filename in the same table as well as the measurement?
    I want the table to look like:
    filename1 measurement1
    filename2 measurement2
    and so on.
    Currently, it just shows
    measurement1
    measurement2
    and so on.
    Here is the VI:
    Solved!
    Go to Solution.
    Attachments:
    measurement.vi ‏68 KB

    You can't use the Express Table. As the properties page says, it is for numeric data. You will have to use a little bit of actual LabVIEW to create the table. A table is just a 2D string array. So, convert the numeric to a string, build a 1D string array from the file name and numberic, and use a shift register to build a 2D array. Something like the code below.
    Message Edited by Dennis Knutson on 05-07-2009 01:43 PM
    Attachments:
    Build Table.PNG ‏9 KB

  • OAF matester detail page : How to have a "Show All" feature on screen, so that all the master and details records are expanded .

    Hi ,
    I was trying to have a "SHOW ALL" feature on the master - detail page,
    the detail table is an advancec table.
    Please help me with inputs on how to have  "SHOW ALL" feature,
    Currently, we have to click on  ":Show" for each record at master level to view the child data.
    Trying to achive "Show All" Feature so that on click of this the master records on the page 'Expands"  showiing all master records with respective detail records.
    Regards
    bhuvanm

    Hi,
    You should not set DetailFlag = "Y" in whereclause because there is no such record.
    Also detail flag is transient attribute and not the query column, hence the error "Invalid indentifier".
    I asked you to use DetailFlag as query column with static value "Y".
    for example:
    SELECT "Y" detail_flag
    FROM <table_name>
    This will display all the table records in expanded format. if you want it conditionally then use decode on some bind parameters.
    For example:
    SELECT DECODE(:1, "SHOWALL", "Y", "N") detail_flag
    FROM <table_name>
    This bind parameter should be passed whenever you want to execute query for the table.
    Regards,
    Sandeep M.

  • How to compare records in the same table?

    I have a table of course registrations.  I would like to select course registrations as of a certain date that do not have a dropped status against it.
    CREATE TABLE REGISTRATIONS
    (ID VARCHAR(7) ,
    COURSE VARCHAR(4),
    CURRENT_STATUS VARCHAR(10),
    STATUS_DATE VARCHAR(10))
    INSERT INTO REGISTRATIONS
    (ID, COURSE, CURRENT_STATUS, STATUS_DATE)
    VALUES
    ('1111111','ADMN', 'REGISTERED', '2014-04-10'),
    ('1111111','MATH', 'REGISTERED', '2014-04-10'),
    ('1111111','ADMN', 'DROPPED', '2014-04-10'),
    ('1111111','MATH', 'DROPPED', '2014-04-12'),
    ('1111111','BIOL', 'REGISTERED', '2014-04-10')
    SELECT * FROM REGISTRATIONS
    ORDER BY COURSE, CURRENT_STATUS
    drop table REGISTRATIONS
    ID COURSE CURRENT_STATUS STATUS_DATE
    1111111 ADMN DROPPED 2014-04-10
    1111111 ADMN REGISTERED 2014-04-10
    1111111 BIOL REGISTERED 2014-04-10
    1111111 MATH DROPPED 2014-04-12
    1111111 MATH REGISTERED 2014-04-10
    The above example shows that ID '1111111' has registered for ADMN and BIOL on April 10th but dropped ADMN the same day.  It also shows that they registered for MATH on April 10th but dropped it on the 12th.
    If I were to select course registrations to date as of April 10 I would see both ADMN records, BIOL and MATH.  BIOL and MATH would be OK but I don't want to see the ADMN data in the result because they have essentially cancelled themselves out. 
    In saying that, how do I write a script to select all course registrations as of a certain date but omit the ones that have been dropped at anytime before the select date?

    check below,
    SELECT * FROM REGISTRATIONS a
    WHERE CURRENT_STATUS <> 'DROPPED' AND STATUS_DATE <= '2014-04-12'
    AND COURSE NOT IN (
    SELECT COURSE FROM REGISTRATIONS
    WHERE CURRENT_STATUS = 'DROPPED' AND STATUS_DATE <= '2014-04-12')
    ORDER BY a.COURSE, a.CURRENT_STATUS

  • Two records from the same table in for loop

    I have a table that holds teams, a table that holds scores and a table that holds match data.
    I am finding it dificult to get the player data for the second team.
    Currently It is showing player information for one team.
    It does echo out the second team name, but not their player info.
    Can someone have a look at my code and make it work.
    I took off the code I had for the second team becuase it was ging me Error 1065
    Main Query:
    mysql_select_db($database_db, $db);
    $query_match_fixtures = "select m.match_id, date_format(m.date, '%d/%m/%Y') as mDate, m.time, t1.division, m.report, t1.team_name as team1_name, s1.score as score1, t2.team_name as team2_name, s2.score as score2
    from matches m left join (matchscores s1 left join team t1 on t1.team_id = s1.team) on (s1.match_id = m.match_id) left join (matchscores s2 left join team t2 on t2.team_id = s2.team) on (s2.match_id = m.match_id)
    where s1.team <> s2.team AND m.match_id = $matchID
    group by match_id
    order by m.match_id";
    $match_fixtures = mysql_query($query_match_fixtures, $db) or die(mysql_error());
    //$row_match_fixtures = mysql_fetch_assoc($match_fixtures);
    $totalRows_match_fixtures = mysql_num_rows($match_fixtures);
    Player extraction:
    mysql_select_db($database_db, $db);
    $row_match_player = array();
    for ($i = 0; $i < $totalRows_history; $i++)
        $row_history[$i] = mysql_fetch_assoc($history);
    for ($i = 0; $i < $totalRows_match_fixtures; $i++)
        $row_match_fixtures[$i] = mysql_fetch_assoc($match_fixtures);
        $match_player_query = "SELECT *
                               FROM match_player
                                LEFT JOIN player on player.player_id = match_player.player_id
                                LEFT JOIN team ON player.team_id = team.team_id
                               WHERE match_id = ".$matchID."
                                AND team.team_name = '".$row_match_fixtures[$i]['team1_name']."'";
        $result_match_player = mysql_query($match_player_query, $db) or die("large error ".mysql_errno());
        $totalRows_match_player = mysql_num_rows($result_match_player);
        for ($r; $r < $totalRows_match_player; $r++)
            $temp_row_match_player[$r] = mysql_fetch_assoc($result_match_player);
        array_push($row_match_player, $temp_row_match_player);
    The display table:
            <div class="tableHeading">
            <h2><?php echo $row_history['mDate']; ?></h2>
            </div>
            <table width="100%" border="0" cellspacing="0" cellpadding="0">
      <tr>
        <td height="25" bgcolor="#000000"><div align="left" style="color:#FFFFFF"><strong>Type</strong></div></td>
        <td height="25" bgcolor="#000000"><div align="left" style="color:#FFFFFF"><strong>Home</strong></div></td>
        <td height="25" bgcolor="#000000"><div align="center" style="color:#FFFFFF"><strong>Score</strong></div></td>
        <td height="25" bgcolor="#000000"><div align="center" style="color:#FFFFFF"><strong>Away</strong></div></td>
        <td height="25" bgcolor="#000000"><div align="center" style="color:#FFFFFF"><strong>Kick-Off</strong></div></td>
        <td height="25" bgcolor="#000000"><div align="center" style="color:#FFFFFF"><strong>Venue</strong></div></td>
        <td height="25" bgcolor="#000000"><div align="center" style="color:#FFFFFF"><strong>Referee</strong></div></td>
      </tr>
      <tr>
        <?php foreach ($row_match_fixtures as $show_match_fixtures)
        { ?>
            <td height="25" bgcolor="#dfdfdf">
            <div align="left"><?php echo $show_match_fixtures['division']; ?></div>
            </td>
            <td height="25" bgcolor="#dfdfdf">
            <div align="left"><?php echo $show_match_fixtures['team1_name']; ?></div>
            </td>
            <td height="25" bgcolor="#dfdfdf">
            <div align="center"><?php echo $show_match_fixtures['score1']; ?> - <?php echo $show_match_fixtures['score2']; ?></div>
            </td>
            <td height="25" bgcolor="#dfdfdf">
            <div align="center"><?php echo $show_match_fixtures['team2_name']; ?></div>
            </td>
            <td height="25" bgcolor="#dfdfdf">
            <!-- You do not want a nested loop inside the header so these results will have to go inside the table-->
            <div align="center"><?php echo $row_history['time']; ?></div>
            </td>
            <td height="25" bgcolor="#dfdfdf">
            <div align="center"><?php echo $row_history['venue_name']; ?></div>
            </td>
            <td height="25" bgcolor="#dfdfdf">
            <div align="center"><?php echo $row_history['fname']; ?> <?php echo $row_history['sname']; ?></div>
            </td>
        </tr>
          <tr>
            <?php foreach ($row_match_player as $player_array)
                   foreach ($player_array as $player_display)
            ?>
            <td valign="top">Goalscorers</td>     
            <td>
              <?php echo $player_display['fname']." ".$player_display['sname']." (".$player_display['Goals']; ?>)<br />
            </td>
            <td> </td>
            <td>
              <?php echo $player_display['fname']." ".$player_display['sname']." (".$player_display['Goals']; ?>)<br />
            </td>
            <td> </td>
            <td> </td>
            <td> </td>
          </tr>
          <tr>
            <td valign="top">Yellow Cards</td>
            <td><?php echo $player_display['YC']; ?></td>
            <td> </td>
            <td><?php echo $player_display['YC']; ?></td>
            <td> </td>
            <td> </td>
            <td> </td>
          </tr>
          <tr>
            <td valign="top">Red Cards</td>
            <td><?php echo $player_display['RC']; ?></td>
            <td> </td>
            <td><?php echo $player_display['RC']; ?></td>
            <td> </td>
            <td> </td>
            <td> </td>
          </tr>
          <tr>
            <td valign="top">Man of the Match</td>
            <td><?php echo $player_display['fname']; ?> <?php echo $player_display['sname']; ?></td>
            <td> </td>
            <td><?php echo $player_display['fname']; ?> <?php echo $player_display['sname']; ?></td>
            <td> </td>
            <td> </td>
            <td> </td>
          </tr>
                <?php
                    }// close and unset $player_display
                    unset($player_display);
                } //close and unset $player_array
            unset($player_array);
         } //close and unset $show_match_fixtures
        unset($show_match_fixtures);?>
    </table>
    As you can see from  the picture above the table is displayed with the name of the "goal  scorer" for that team under (home) or Home team
    When I try to create the same thing for away team I get a error, either a syntax error or 1065.
    I tried having a foreach do two queries but that did not work.
    Any help would be appriecated

    I did try that, but I have messed it up.
    Now the team names do not display at the top of the table.

  • Compare several records in the same table

    Hello, i´m writing a BAT file so i can export some information that i query.
    I have a automatic integration that from time to time checks if there is any new client´s and generates a trigger.
    If an error ocurs i it will repeat the process until the client is in the database.
    I cannot create tables or modify structure.
    My problem is that i need to compare the most updated record with the field CLIENT_ID
    Let me give up an example:
    Table A
    CLIENT_ID CREATEDTIME ERROR_MESSAGE
    0 01-01-2009 Sucess
    1 01-01-2009 Error
    2 01-01-2009 Sucess
    1 02-01-2009 Sucess
    3 02-01-2009 Sucess
    4 02-01-2009 Error
    I need to compare client "1" created on 01-01-2009 that gived Error with all new records to see if is Sucess and my
    query should only return the client_ID "4" and export with sqlplus
    Could you please help me out?

    with my_tab as (select 0 client_id, to_date('01/01/2009', 'dd/mm/yyyy') createdtime, 'Sucess' error_message from dual union all
                    select 1 client_id, to_date('01/01/2009', 'dd/mm/yyyy') createdtime, 'Error' error_message from dual union all
                    select 2 client_id, to_date('01/01/2009', 'dd/mm/yyyy') createdtime, 'Sucess' error_message from dual union all
                    select 1 client_id, to_date('02/01/2009', 'dd/mm/yyyy') createdtime, 'Sucess' error_message from dual union all
                    select 3 client_id, to_date('02/01/2009', 'dd/mm/yyyy') createdtime, 'Sucess' error_message from dual union all
                    select 4 client_id, to_date('02/01/2009', 'dd/mm/yyyy') createdtime, 'Error' error_message from dual)
    -- end of test data set up to mimic a table called "my_tab"
    select client_id
    from   my_tab
    group by client_id
    having max(decode(error_message, 'Error', 1, 2)) = 1;should do what you want.
    Edited by: Boneist on 05-Jan-2009 16:06
    Hmm, not quite.... thinking of an amendment if the answer to BluShadow's question is Yes
    Aha,
    with my_tab as (select 0 client_id, to_date('01/01/2009', 'dd/mm/yyyy') createdtime, 'Sucess' error_message from dual union all
                    select 1 client_id, to_date('01/01/2009', 'dd/mm/yyyy') createdtime, 'Error' error_message from dual union all
                    select 2 client_id, to_date('01/01/2009', 'dd/mm/yyyy') createdtime, 'Sucess' error_message from dual union all
                    select 1 client_id, to_date('02/01/2009', 'dd/mm/yyyy') createdtime, 'Sucess' error_message from dual union all
                    select 3 client_id, to_date('02/01/2009', 'dd/mm/yyyy') createdtime, 'Sucess' error_message from dual union all
                    select 4 client_id, to_date('02/01/2009', 'dd/mm/yyyy') createdtime, 'Error' error_message from dual union all
                    select 1 client_id, to_date('03/01/2009', 'dd/mm/yyyy') createdtime, 'Error' error_message from dual)
    -- end of test data set up to mimic a table called "my_tab"
    select client_id
    from   my_tab
    group by client_id
    having max(decode(error_message, 'Error', 1, 2)) keep (dense_rank last order by createdtime) = 1;(which happens to be a more generalised form of what Frank's posted below!)

  • HCM Process and Forms - Create and End record using the same form scenario

    Hi All,
    I have the following requirement while using HCM Processes and Forms: Using one form/scenario I need to both create a record or be able to end a record for infotype 841. When looking at the back-end service SAP_PA I have operations Create, Change, Change without delimiting and Delete. My requirement would be to do both a create and a delete I guess, but these two can't be selected at the same time while configuring the form scenario.
    I was thinking about doing somethign with the startdate and enddate instead of using the effective date. But I have no clue how to do that.
    How would this be possible?
    Thanks,
    J

    You are correct in assuming that you cannot have a create and delete on the same infotype. The config will not allow it.  Instead, configure the create and then do the delete via a call to you own method in the workflow or via the advanced generic service
    Cheers
    Ian

Maybe you are looking for

  • Remove push and sms notifications during a call

    it is possible to remove audio (push and sms notifications) during a call? if not, fix it!!!!

  • IMac - what graphic card best suited for Aperture???

    Hi, I'm considering buying the 24" iMac to use with Aperture 2.1.2, however it comes with the option of two graphics cards: ATI Radeon HD 2600 PRO w/256MB GDDR3 NVIDIA GeForce 8800 GS w/512MB GDDR3 I don't play any games, so what I want is the best c

  • Published photos don't link

    I published some photos a few days ago and shared them with people who needed to see them.   But the link fails every time they or I try it. When we go to http://web.me.com/pbrazee/Site/Zoo_day_2011-09-02.html , Every day, I get the following in many

  • Add On Problem

    hi guys, I found one problem. I made connection using single sign on. In addon multiple form is available. I connect from one form to SBO well. I paste the same code for connection in second form. But in second form I found error in this statement. S

  • Java and Access

    Hi! I have one table "Student" and one "Course". They are connected via a many-to-many relationship. The database is Access. In the connecting table I register the grades the student get on a course. This works fine in some cases but not in others. I