postgresql7.1
insert into acs_mail_lite_queue
(message_id,
creation_date,
locking_server,
to_addr,
cc_addr,
bcc_addr,
from_addr,
reply_to,
subject,
body,
package_id,
file_ids,
filesystem_files,
delete_filesystem_files_p,
mime_type,
no_callback_p,
extraheaders,
use_sender_p,
object_id
)
values
(nextval('acs_mail_lite_id_seq'),
:creation_date,
:locking_server,
:to_addr,
:cc_addr,
:bcc_addr,
:from_addr,
:reply_to,
:subject,
:body,
:package_id,
:file_ids,
:filesystem_files,
(case when :delete_filesystem_files_p = '1' then TRUE else FALSE end),
:mime_type,
(case when :no_callback_p = '1' then TRUE else FALSE end),
:extraheaders,
(case when :use_sender_p = '1' then TRUE else FALSE end),
:object_id
)
select
message_id as id,
creation_date,
locking_server,
to_addr,
cc_addr,
bcc_addr,
from_addr,
reply_to,
subject,
body,
package_id,
file_ids,
(case when delete_filesystem_files_p = TRUE then 1 else 0 end) as delete_filesystem_files_p,
filesystem_files,
mime_type,
(case when no_callback_p = TRUE then 1 else 0 end) as no_callback_p,
extraheaders,
(case when use_sender_p = TRUE then 1 else 0 end) as use_sender_p,
object_id
from acs_mail_lite_queue
where locking_server = '' or locking_server is NULL