postgresql7.1
select ml_mailing_list__new (
:list_id,
:package_id,
:name,
:locale,
:teaser,
:sender_email,
:confirm_subject,
:confirm_body,
:confirm_mime_type,
:welcome_subject,
:welcome_body,
:welcome_mime_type,
:remind_subject,
:remind_body,
:remind_mime_type,
$expiration_date,
:first_reminder,
:second_reminder,
:comments,
:package_id,
:user_id,
current_timestamp,
:creation_ip
);
select ml_mailing_list__edit (
:list_id,
:name,
:locale,
:teaser,
:sender_email,
:confirm_subject,
:confirm_body,
:confirm_mime_type,
:welcome_subject,
:welcome_body,
:welcome_mime_type,
:remind_subject,
:remind_body,
:remind_mime_type,
$expiration_date,
:first_reminder,
:second_reminder,
:comments,
:user_id,
:modifying_ip
);
insert into ml_mailing_list_user_map
(list_id, user_id, confirmed_p, subscribed_p, subscription_date)
values (:list_id, :user_id, :confirmed_p, :confirmed_p, current_timestamp)
select m.user_id, ml.sender_email, ml.remind_subject,
ml.remind_body, ml.remind_mime_type, l.mime_charset,
ml.list_id, n.node_id, ml.package_id
from ml_mailing_lists ml, ml_mailing_list_user_map m,
ad_locales l, site_nodes n
where m.list_id = ml.list_id
and ml.locale = l.locale
and m.confirmed_p = 'f'
and n.object_id = ml.package_id
and ml.remind_body is not null
and ((m.reminder_count = 0
and ml.first_reminder > 0
and m.subscription_date < (current_timestamp -
(cast (ml.first_reminder || ' days' as interval))
))
or (m.reminder_count = 1
and ml.second_reminder > 0
and m.subscription_date < (current_timestamp -
(cast (ml.second_reminder || ' days' as interval)))
)
)
select ml_mail_class__new (
:mail_class_id,
:package_id,
:name,
:locale,
:sender_email,
:subject,
:subject_change_p,
null,
:text_header_change_p,
null,
:text_body_change_p,
null,
:text_footer_change_p,
null,
:html_header_change_p,
null,
:html_body_change_p,
null,
:html_footer_change_p,
:mime_type,
null,
:package_id,
:user_id,
current_timestamp,
:creation_ip
);
select ml_mail_class__edit (
:mail_class_id,
:name,
:locale,
:sender_email,
:subject,
:subject_change_p,
null,
:text_header_change_p,
null,
:text_body_change_p,
null,
:text_footer_change_p,
null,
:html_header_change_p,
null,
:html_body_change_p,
null,
:html_footer_change_p,
:mime_type,
null,
:user_id,
:modifying_ip);
select ml_mail_job__new (
null,
:class_id,
:list_id,
:selection_id,
:package_id,
:locale,
:sender_email,
:track_links_p,
:subject,
null,
null,
null,
null,
null,
null,
:template_p,
:mime_type,
:state,
$scheduled_date,
:bind_vars,
:class_id,
:user_id,
current_timestamp,
:creation_ip);
select ml_mail_job__edit (
:mail_job_id,
:locale,
:sender_email,
:track_links_p,
:subject,
null,
null,
null,
null,
null,
null,
:template_p,
:mime_type,
:state,
$scheduled_date,
:bind_vars,
:user_id,
:modifying_ip);