This table keeps track of all opt-ins and opt-outs for patrons interacting with public and private lists for an organization, or organizations in a consrotium. All consortium members share this table.
[m2_list_no] [int] NOT NULL,
[address] [varchar](80) NOT NULL,
[status] [char](10) NOT NULL,
[created_by] [char](8) NULL,
[create_dt] [datetime] NULL,
[create_loc] [varchar](16) NULL,
[last_update_dt] [datetime] NULL,
[last_updated_by] [char](8) NULL
For each list that a patron is opted in to or out of for an organization, a row is created in this table. If the patron has never opted in or out for a particular list, they do not have a row in this table for that list. When a patron opts in to a list, the address is entered in this table along with the list id from the [id] field in LTR_M2_ELISTS. The [status] field is marked as 'active'. If a patron opts out of a list, the [status] field is marked as 'inactive'. This table is indexed by [address] and [m2_list_no].
DELETE FROM LTX_M2_ELISTS_EADDRESS where (m2_list_no in(select id from LTR_M2_ELISTS WHERE active = 'N')
OR NOT EXISTS(SELECT * FROM LTR_M2_ELISTS WHERE id = m2_list_no))
DELETE FROM LTR_M2_ELISTS where active = 'N'