DBA Data[Home] [Help]

APPS.CSI_INSTANCE_PARTIES_VLD_PVT SQL Statements

The following lines contain the word 'select', 'insert', 'update' or 'delete':

Line: 89

	SELECT instance_party_id
    INTO l_inst_party_id
	FROM csi_i_parties
	WHERE instance_id        = p_instance_id
      and party_source_table     = p_party_source_table
      and party_id               = p_party_id
      and relationship_type_code = p_relationship_type
      and contact_flag           = p_contact_flag
      and NVL(contact_ip_id,fnd_api.g_miss_num) = nvl(p_contact_ip_id,fnd_api.g_miss_num)
      and ((active_end_date is null) OR (active_end_date >= sysdate));
Line: 133

    SELECT 'x'
      INTO l_dummy
     FROM csi_i_parties
    WHERE instance_party_id = p_Instance_party_id;
Line: 163

	SELECT 'x'
	FROM csi_item_instances
	WHERE instance_id = p_instance_id
      and ((active_end_date is null) OR (active_end_date >= sysdate));
Line: 200

  	SELECT 'x'
	FROM csi_lookups
	WHERE lookup_code = UPPER(p_party_source_table)
        AND lookup_type   = l_pty_lookup_type;
Line: 239

        SELECT 'x'
        INTO l_dummy
	FROM hz_parties
	WHERE party_id = p_party_id;
Line: 246

          SELECT 'x'
	  INTO l_dummy
	  FROM po_vendor_contacts
	  WHERE vendor_contact_id = p_party_id;
Line: 251

          SELECT 'x'
	    INTO l_dummy
	    FROM po_vendors
	    WHERE vendor_id = p_party_id
            AND ((end_date_active is null) OR (end_date_active >= sysdate));
Line: 259

        SELECT 'x'
        INTO l_dummy
	FROM per_all_people_f
	WHERE person_id = p_party_id
        AND ((effective_end_date is null) OR (effective_end_date >= sysdate))
        AND rownum < 2;
Line: 267

        SELECT 'x'
        INTO l_dummy
	FROM jtf_rs_teams_vl
	WHERE team_id = p_party_id
        AND ((end_date_active is null) OR (end_date_active >= sysdate));
Line: 274

        SELECT 'x'
        INTO l_dummy
	FROM jtf_rs_groups_vl
	WHERE group_id = p_party_id
        AND ((end_date_active is null) OR (end_date_active >= sysdate));
Line: 317

    select 'x'
      into l_dummy
     from csi_ipa_relation_types
    where ipa_relation_type_code = UPPER(p_party_rel_type_code)
      and party_use_flag = 'Y';
Line: 324

    select 'x'
      into l_dummy
     from csi_ipa_relation_types
    where ipa_relation_type_code = UPPER(p_party_rel_type_code)
      and account_use_flag = 'Y';
Line: 331

    select 'x'
     into l_dummy
     from csi_ipa_relation_types
    where ipa_relation_type_code = UPPER(p_party_rel_type_code)
      and contact_use_flag = 'Y';
Line: 369

 SELECT cip.party_id,
        cip.party_source_table
 FROM   csi_i_parties cip,
        csi_item_instances cii
 WHERE  cip.instance_party_id = i_inst_party_id
 AND    cip.instance_id = cii.instance_id
 AND   ((cip.active_end_date IS NULL) OR (cip.active_end_date >= SYSDATE));
Line: 380

   SELECT 'x'
   FROM     hz_relationships r
   ,        hz_org_contacts c
   ,        ar_lookups l
   WHERE   (r.object_id = i_party_id
            OR
            r.object_id IN (SELECT DISTINCT ha.party_id
                            FROM   hz_cust_accounts ha
                                  ,hz_cust_acct_relate_all rel
                                  ,hz_cust_accounts hz
                            WHERE  ha.cust_account_id=rel.related_cust_account_id
                            AND    rel.cust_account_id=hz.cust_account_id
                            AND    rel.status='A'
                            AND    hz.party_id=i_party_id)
             )
   AND      r.relationship_id = c.party_relationship_id
   AND      r.subject_id = i_contact_id
   AND      r.directional_flag = 'F'
   AND      r.relationship_code = l.lookup_code
   AND      l.lookup_type = 'PARTY_RELATIONS_TYPE';
Line: 458

	SELECT active_start_date,
               active_end_date
	FROM  csi_item_instances
	WHERE instance_id = p_instance_id
      and ((active_end_date is null) OR (active_end_date >= sysdate));
Line: 519

	SELECT active_end_date,
               active_start_date
	FROM csi_item_instances
	WHERE instance_id = p_instance_id
    and ((active_end_date is null) OR (active_end_date >= sysdate));
Line: 576

	SELECT active_end_date,
               active_start_date
	FROM csi_item_instances
	WHERE instance_id = p_instance_id
    and ((active_end_date is null) OR (active_end_date >= sysdate));
Line: 649

      SELECT instance_party_id
      FROM   csi_i_parties
      WHERE  contact_ip_id = p_instance_party_id
      AND    ((active_end_date is null) or (active_end_date > sysdate));
Line: 655

      SELECT ip_account_id
      FROM   csi_ip_accounts
      WHERE  instance_party_id = p_instance_party_id
      AND    ((active_end_date is null) or (active_end_date > sysdate));
Line: 662

      SELECT MAX(t.source_transaction_date) -- Changed from Transaction_date to Source_transaction_date
      INTO   l_transaction_date
      FROM   csi_i_parties_h s,
             csi_transactions t
      WHERE  s.instance_party_id=p_instance_party_id
      AND    s.transaction_id=t.transaction_id
	 AND    t.transaction_id <>nvl(p_txn_id, -99999);
Line: 682

            SELECT MAX(t.source_transaction_date) -- Changed from Transaction_date to Source_transaction_date
            INTO   l_transaction_date
            FROM   csi_i_parties_h s,
                   csi_transactions t
            WHERE  s.instance_party_id=l_contact_temp
            AND    s.transaction_id=t.transaction_id
	       AND    t.transaction_id <> nvl(p_txn_id, -99999);
Line: 704

            SELECT MAX(t.source_transaction_date) -- Changed from Transaction_date to Source_transaction_date
            INTO   l_transaction_date
            FROM   csi_ip_accounts_h s,
                   csi_transactions t
            WHERE  s.ip_account_id =l_account_temp
            AND    s.transaction_id=t.transaction_id
	       AND    t.transaction_id <> nvl(p_txn_id, -99999);
Line: 743

    SELECT 'x'
    FROM csi_i_parties
   WHERE instance_id = p_Instance_id
   AND   instance_party_id <> l_inst_party_id  -- Ignore the current instance_party_id
    AND  relationship_type_code = 'OWNER'
    and ((active_end_date is null) OR (active_end_date >= sysdate));
Line: 786

    SELECT CSI_I_PARTIES_S.nextval
     INTO l_inst_party_id
     FROM sys.dual;
Line: 802

    SELECT CSI_I_PARTIES_H_S.nextval
      INTO l_inst_party_his_id
      FROM sys.dual;
Line: 822

    SELECT 'x'
    INTO l_dummy
    FROM csi_item_instances
	WHERE instance_id = p_Instance_id
      AND ((active_end_date is null) OR (active_end_date >= sysdate))
      AND creation_complete_flag = 'Y';
Line: 854

   SELECT 'x'
    INTO  l_dummy
    FROM  csi_ip_accounts
   WHERE  instance_party_id      = p_instance_party_id
     and  party_account_id       = p_party_account_id
     and  relationship_type_code = p_relationship_type
     and ((active_end_date is null) OR (active_end_date >= sysdate));
Line: 887

   	SELECT 'x'
     INTO l_dummy
	FROM csi_ip_accounts
	WHERE ip_account_id = p_ip_account_id
      and ((active_end_date is null) OR (active_end_date >= sysdate));
Line: 921

    SELECT instance_party_id
    INTO l_inst_party_id
    FROM csi_i_parties
    WHERE instance_party_id = p_Instance_party_id;
Line: 951

    SELECT instance_id
    INTO l_instance_id
    FROM csi_i_parties
    WHERE instance_party_id = p_Instance_party_id
    AND ((active_end_date is null) OR (active_end_date >= sysdate));
Line: 970

      SELECT instance_id
      INTO l_instance_id
      FROM csi_i_parties
      WHERE instance_party_id = p_Instance_party_id;
Line: 1013

	SELECT 'x'
	  FROM hz_cust_accounts
	 WHERE cust_account_id = i_party_account_id;
Line: 1019

      SELECT 'x'
	FROM  hz_cust_accounts hzca,
              hz_parties  hzp
       WHERE  hzca.cust_account_id = i_party_account_id
         AND  hzca.party_id = i_party_id
         AND  hzca.party_id = hzp.party_id;
Line: 1027

     SELECT party_id,
            party_source_table
      FROM  csi_i_parties
     WHERE  instance_party_id = i_inst_party_id
       AND ((active_end_date is null) OR (active_end_date >= sysdate));
Line: 1045

        SELECT party_id,
               party_source_table
        INTO   l_party_id,
               l_party_source_table
        FROM   csi_i_parties
        WHERE  instance_party_id = p_instance_party_id;
Line: 1125

    select 'x'
    from csi_ipa_relation_types
    where ipa_relation_type_code = UPPER(p_acct_rel_type_code)
      and account_use_flag = 'Y';
Line: 1162

	SELECT active_start_date
	 FROM csi_i_parties
	WHERE instance_party_id = p_instance_party_id
      and ((active_end_date is null) OR (active_end_date >= sysdate));
Line: 1226

	SELECT active_end_date
	FROM csi_i_parties
	WHERE instance_party_id = p_inst_party_id
     and ((active_end_date is null) OR (active_end_date >= sysdate));
Line: 1281

	SELECT active_end_date
	FROM csi_i_parties
	WHERE instance_party_id = p_inst_party_id
     and ((active_end_date is null) OR (active_end_date >= sysdate));
Line: 1305

         SELECT MAX(t.source_transaction_date) -- Changed from Transaction_date to Source_transaction_date
         INTO   l_transaction_date
         FROM   csi_ip_accounts_h s,
                csi_transactions t
         WHERE  s.ip_account_id=p_ip_account_id
         AND    s.transaction_id=t.transaction_id
	 AND    t.transaction_id <> nvl(p_txn_id, -99999);
Line: 1356

    SELECT CSI_IP_ACCOUNTS_S.nextval
     INTO l_ip_account_id
    FROM sys.dual;
Line: 1372

     SELECT CSI_IP_ACCOUNTS_H_S.nextval
       INTO l_ip_account_hist_id
       FROM sys.dual;
Line: 1396

	SELECT active_start_date,
           active_end_date
	FROM csi_item_instances
	WHERE instance_id = p_instance_id
      and ((active_end_date is null) OR (active_end_date >= sysdate));
Line: 1439

 SELECT CSI_I_VERSION_LABELS_S.nextval
  INTO  l_version_label_id
  FROM sys.dual;
Line: 1459

   	SELECT 'x'
     INTO l_dummy
	FROM csi_i_version_labels
	WHERE version_label_id = p_version_label_id
     and ((active_end_date is null) OR (active_end_date >= sysdate));
Line: 1487

 SELECT CSI_I_VERSION_LABELS_H_S.nextval
  INTO  l_version_label_hist_id
  FROM sys.dual;
Line: 1507

 SELECT CSI_I_ASSETS_S.nextval
  INTO  l_inst_asset_id
  FROM sys.dual;
Line: 1530

   	SELECT 'x'
     INTO l_dummy
     FROM csi_i_assets
	WHERE instance_asset_id = p_instance_asset_id ;
Line: 1549

/* Procedure name: Is_Update_Status_Exists                   */
/* Description : Check if the update status  is              */
/*              defined in CSI_LOOKUPS                       */
/*-----------------------------------------------------------*/

FUNCTION Is_Update_Status_Exists
(
    p_update_status         IN      VARCHAR2,
    p_stack_err_msg         IN      BOOLEAN DEFAULT TRUE
) RETURN BOOLEAN IS

	l_dummy                 VARCHAR2(1);
Line: 1562

        l_asset_lookup_type     VARCHAR2(30) := 'CSI_ASSET_UPDATE_STATUS';
Line: 1565

	SELECT 'x'
	FROM CSI_LOOKUPS
	WHERE  lookup_code    = UPPER(p_update_status)
        AND  lookup_type    = l_asset_lookup_type;
Line: 1575

		   FND_MESSAGE.SET_NAME('CSI','CSI_API_INV_UPDATE_STATUS');
Line: 1576

		   FND_MESSAGE.SET_TOKEN('UPDATE_STATUS',p_update_status);
Line: 1583

END Is_Update_Status_Exists;
Line: 1622

  SELECT CSI_I_ASSETS_H_S.nextval
  INTO  l_inst_asset_hist_id
  FROM sys.dual;
Line: 1642

   	SELECT 'x'
     INTO l_dummy
     FROM fa_books
	WHERE asset_id       = p_asset_id
      and book_type_code = p_book_type_code;
Line: 1674

   	SELECT 'x'
     INTO l_dummy
     FROM csi_a_locations
	WHERE location_id       = p_location_id
      and ((active_end_date is null) OR (active_end_date >= sysdate));
Line: 1706

   	SELECT 'x'
     INTO l_dummy
	FROM csi_ip_accounts
	WHERE ip_account_id = p_ip_account_id;
Line: 1730

   	SELECT 'x'
     INTO l_dummy
	FROM csi_ip_accounts
	WHERE ip_account_id = p_ip_account_id
      and ((active_end_date is null) OR (active_end_date >= sysdate));
Line: 1755

   	SELECT 'x'
        INTO l_dummy
	FROM hz_cust_site_uses_all
	WHERE site_use_id = p_bill_to_add_id
        AND site_use_code = 'BILL_TO';
Line: 1787

   	SELECT 'x'
        INTO l_dummy
	FROM hz_cust_site_uses_all
	WHERE site_use_id = p_ship_to_add_id
        AND site_use_code = 'SHIP_TO';
Line: 1826

   SELECT 'x'
    INTO  l_dummy
    FROM  csi_ip_accounts
   WHERE  instance_party_id      = p_instance_party_id
     and  relationship_type_code = p_relationship_type
     and ((active_end_date is null) OR (active_end_date > sysdate));
Line: 1871

	SELECT instance_party_id
        INTO l_inst_party_id
	FROM csi_i_parties
	WHERE contact_ip_id = p_contact_ip_id
        AND   contact_flag  = 'Y';
Line: 1909

    SELECT relationship_type_code
      INTO l_rel_type_code
     FROM csi_i_parties
    WHERE instance_party_id = p_Instance_party_id;
Line: 1937

    SELECT
      instance_party_id                  ,
      instance_id                        ,
      party_source_table                 ,
      party_id                           ,
      relationship_type_code             ,
      contact_flag                       ,
      contact_ip_id                      ,
      active_start_date                  ,
      active_end_date                    ,
      context                            ,
      attribute1                         ,
      attribute2                         ,
      attribute3                         ,
      attribute4                         ,
      attribute5                         ,
      attribute6                         ,
      attribute7                         ,
      attribute8                         ,
      attribute9                         ,
      attribute10                        ,
      attribute11                        ,
      attribute12                        ,
      attribute13                        ,
      attribute14                        ,
      attribute15                        ,
      object_version_number              ,
      primary_flag                       ,
      preferred_flag
    INTO
      p_party_rec.instance_party_id                  ,
      p_party_rec.instance_id                        ,
      p_party_rec.party_source_table                 ,
      p_party_rec.party_id                           ,
      p_party_rec.relationship_type_code             ,
      p_party_rec.contact_flag                       ,
      p_party_rec.contact_ip_id                      ,
      p_party_rec.active_start_date                  ,
      p_party_rec.active_end_date                    ,
      p_party_rec.context                            ,
      p_party_rec.attribute1                         ,
      p_party_rec.attribute2                         ,
      p_party_rec.attribute3                         ,
      p_party_rec.attribute4                         ,
      p_party_rec.attribute5                         ,
      p_party_rec.attribute6                         ,
      p_party_rec.attribute7                         ,
      p_party_rec.attribute8                         ,
      p_party_rec.attribute9                         ,
      p_party_rec.attribute10                        ,
      p_party_rec.attribute11                        ,
      p_party_rec.attribute12                        ,
      p_party_rec.attribute13                        ,
      p_party_rec.attribute14                        ,
      p_party_rec.attribute15                        ,
      p_party_rec.object_version_number              ,
      p_party_rec.primary_flag                       ,
      p_party_rec.preferred_flag
    FROM  csi_i_parties
    WHERE instance_party_id = p_Instance_party_id;
Line: 2024

   SELECT 'x'
    INTO  l_dummy
    FROM  csi_ip_accounts
   WHERE instance_party_id      = p_party_account_rec.instance_party_id
     AND party_account_id       = p_party_account_rec.party_account_id
     AND relationship_type_code = p_party_account_rec.relationship_type_code
     AND active_start_date      = p_party_account_rec.active_start_date
     AND active_end_date        < sysdate
     AND decode(p_party_account_rec.bill_to_address,
            NULL, NVL(bill_to_address, 1),
            bill_to_address)     = NVL(p_party_account_rec.bill_to_address, 1)
     AND decode(p_party_account_rec.ship_to_address,
            NULL, NVL(ship_to_address, 1),
             ship_to_address)     = NVL(p_party_account_rec.ship_to_address, 1)
     AND decode(p_party_account_rec.context,
            NULL, NVL(context, '1'),
                   context)     = NVL(p_party_account_rec.context, '1')
     AND decode(p_party_account_rec.attribute1,
            NULL, NVL(attribute1, '1'),
                   attribute1)     = NVL(p_party_account_rec.attribute1, '1')
     AND decode(p_party_account_rec.attribute2,
            NULL, NVL(attribute2, '1'),
                   attribute2)     = NVL(p_party_account_rec.attribute2, '1')
     AND decode(p_party_account_rec.attribute3,
            NULL, NVL(attribute3, '1'),
                   attribute3)     = NVL(p_party_account_rec.attribute3, '1')
     AND decode(p_party_account_rec.attribute4,
            NULL, NVL(attribute4, '1'),
                   attribute4)     = NVL(p_party_account_rec.attribute4, '1')
     AND decode(p_party_account_rec.attribute5,
            NULL, NVL(attribute5, '1'),
                   attribute5)     = NVL(p_party_account_rec.attribute5, '1')
     AND decode(p_party_account_rec.attribute6,
            NULL, NVL(attribute6, '1'),
                   attribute6)     = NVL(p_party_account_rec.attribute6, '1')
     AND decode(p_party_account_rec.attribute7,
            NULL, NVL(attribute7, '1'),
                   attribute7)     = NVL(p_party_account_rec.attribute7, '1')
     AND decode(p_party_account_rec.attribute8,
            NULL, NVL(attribute8, '1'),
                   attribute8)     = NVL(p_party_account_rec.attribute8, '1')
     AND decode(p_party_account_rec.attribute9,
            NULL, NVL(attribute9, '1'),
                   attribute9)     = NVL(p_party_account_rec.attribute9, '1')
     AND decode(p_party_account_rec.attribute10,
            NULL, NVL(attribute10, '1'),
                   attribute10)     = NVL(p_party_account_rec.attribute10, '1')
     AND decode(p_party_account_rec.attribute11,
            NULL, NVL(attribute11, '1'),
                   attribute11)     = NVL(p_party_account_rec.attribute11, '1')
     AND decode(p_party_account_rec.attribute12,
            NULL, NVL(attribute12, '1'),
                   attribute12)     = NVL(p_party_account_rec.attribute12, '1')
     AND decode(p_party_account_rec.attribute13,
            NULL, NVL(attribute13, '1'),
                   attribute13)     = NVL(p_party_account_rec.attribute13, '1')
     AND decode(p_party_account_rec.attribute14,
            NULL, NVL(attribute14, '1'),
                   attribute14)     = NVL(p_party_account_rec.attribute14, '1')
     AND decode(p_party_account_rec.attribute15,
            NULL, NVL(attribute15, '1'),
                   attribute15)     = NVL(p_party_account_rec.attribute15, '1');
Line: 2131

  SELECT 'x'
    INTO l_dummy
    FROM csi_i_parties
   WHERE instance_id            = p_party_rec.instance_id
     AND party_source_table     = p_party_rec.party_source_table
     AND party_id               = p_party_rec.party_id
     AND relationship_type_code = p_party_rec.relationship_type_code
     AND contact_flag           = p_party_rec.contact_flag
     AND decode(p_party_rec.contact_ip_id,
           NULL, NVL(contact_ip_id, 1),
                 contact_ip_id) = NVL(p_party_rec.contact_ip_id, 1)
     AND active_start_date      = p_party_rec.active_start_date
     AND active_end_date        < sysdate
     AND decode(p_party_rec.context,
            NULL, NVL(context, '1'),
                   context)     = NVL(p_party_rec.context, '1')
     AND decode(p_party_rec.attribute1,
            NULL, NVL(attribute1, '1'),
                   attribute1)     = NVL(p_party_rec.attribute1, '1')
     AND decode(p_party_rec.attribute2,
            NULL, NVL(attribute2, '1'),
                   attribute2)     = NVL(p_party_rec.attribute2, '1')
     AND decode(p_party_rec.attribute3,
            NULL, NVL(attribute3, '1'),
                   attribute3)     = NVL(p_party_rec.attribute3, '1')
     AND decode(p_party_rec.attribute4,
            NULL, NVL(attribute4, '1'),
                   attribute4)     = NVL(p_party_rec.attribute4, '1')
     AND decode(p_party_rec.attribute5,
            NULL, NVL(attribute5, '1'),
                   attribute5)     = NVL(p_party_rec.attribute5, '1')
     AND decode(p_party_rec.attribute6,
            NULL, NVL(attribute6, '1'),
                   attribute6)     = NVL(p_party_rec.attribute6, '1')
     AND decode(p_party_rec.attribute7,
            NULL, NVL(attribute7, '1'),
                   attribute7)     = NVL(p_party_rec.attribute7, '1')
     AND decode(p_party_rec.attribute8,
            NULL, NVL(attribute8, '1'),
                   attribute8)     = NVL(p_party_rec.attribute8, '1')
     AND decode(p_party_rec.attribute9,
            NULL, NVL(attribute9, '1'),
                   attribute9)     = NVL(p_party_rec.attribute9, '1')
     AND decode(p_party_rec.attribute10,
            NULL, NVL(attribute10, '1'),
                   attribute10)     = NVL(p_party_rec.attribute10, '1')
     AND decode(p_party_rec.attribute11,
            NULL, NVL(attribute11, '1'),
                   attribute11)     = NVL(p_party_rec.attribute11, '1')
     AND decode(p_party_rec.attribute12,
            NULL, NVL(attribute12, '1'),
                   attribute12)     = NVL(p_party_rec.attribute12, '1')
     AND decode(p_party_rec.attribute13,
            NULL, NVL(attribute13, '1'),
                   attribute13)     = NVL(p_party_rec.attribute13, '1')
     AND decode(p_party_rec.attribute14,
            NULL, NVL(attribute14, '1'),
                   attribute14)     = NVL(p_party_rec.attribute14, '1')
     AND decode(p_party_rec.attribute15,
            NULL, NVL(attribute15, '1'),
                   attribute15)     = NVL(p_party_rec.attribute15, '1');
Line: 2230

    SELECT ip_account_id,
           relationship_type_code, -- Added by sguthiva for bug 2307804
           party_account_id,       -- Added by sguthiva for bug 2307804
           object_version_number
    FROM csi_ip_accounts
    WHERE instance_party_id = i_inst_party_id
    AND (( ACTIVE_END_DATE IS NULL) OR (ACTIVE_END_DATE >= SYSDATE)) ;
Line: 2398

    SELECT 'x'
    FROM csi_i_parties
   WHERE instance_id = p_Instance_id
    -- AND  relationship_type_code = p_relationship_type
    AND  preferred_flag = 'Y'
    AND  contact_flag = 'Y'
    AND ((active_end_date is null) OR (active_end_date >= sysdate))
    AND NVL(active_end_date, SYSDATE) >= DECODE(active_end_date, NULL, SYSDATE,  NVL(p_start_date, FND_API.G_MISS_DATE));
Line: 2447

    SELECT 'x'
    FROM csi_i_parties
   WHERE instance_id = p_Instance_id
    AND  relationship_type_code = p_relationship_type
    AND  primary_flag = 'Y'
    AND  contact_flag = 'Y'
    AND  contact_ip_id = p_contact_ip_id
    AND ((active_end_date is null) OR (active_end_date > p_start_date));
Line: 2496

    SELECT 'x'
    FROM csi_i_parties
   WHERE instance_id = p_Instance_id
    -- AND  relationship_type_code = p_relationship_type
    AND  preferred_flag = 'Y'
    AND  contact_flag <> 'Y'
    AND ((active_end_date is null) OR (active_end_date >= sysdate))
    AND NVL(active_end_date, SYSDATE) >= DECODE(active_end_date, NULL, SYSDATE,  NVL(p_start_date, FND_API.G_MISS_DATE));
Line: 2546

    SELECT 'x'
    FROM  csi_i_parties
    WHERE instance_id = p_Instance_id
    AND   relationship_type_code = p_relationship_type
    AND   primary_flag = 'Y'
    AND   contact_flag <> 'Y'
    AND ((active_end_date IS NULL) OR (active_end_date > p_start_date));