Oracle 插入数据

6个柜面交易 打印修改
--050101
delete from tran_prints where tran_id = (select id from tran where code='050101');
insert into tran_prints values(tran_prints_seq.nextval, (select id from tran where code='050101'), (select id from prints where name = '二联通用凭证'), 1);
delete from tran_def_images where tran_task_id =(select id from tran_task where code='050101');
insert into tran_def_images values(tran_def_images_seq.nextval, (select id from tran_task where code='050101'), '0024', 'A', 0);
insert into tran_def_images values(tran_def_images_seq.nextval, (select id from tran_task where code='050101'), '0025', 'A', 1);
insert into tran_def_images values(tran_def_images_seq.nextval, (select id from tran_task where code='050101'), '0070', 'A', 2);
insert into tran_def_images values(tran_def_images_seq.nextval, (select id from tran_task where code='050101'), '0008', 'T', 0);

select entry.id,entry.peer_id, entry.tran_jrnl_id, account1.account_no,
to_char(entry.fiscal_date,'YYYY-MM-DD') as fiscal_date2,entry.summary_type_code,
DECODE(entry.direct,'C','贷','D','借','未知方向') as entry_direct , entry.amount, entry.balance,
DECODE(entry.balance_direct,'C','贷','D','借','未知方向') as balance_direct , entry.voucher_number, entry.voucher_type,
DECODE(account1.direct,'C','贷','D','借','未知方向') as account_direct, entry.entry_type_code , entry.OCCUR_STAMP, entry.usage
from account account1, entry
where ( account1.account_no = '%s' and account1.id = entry.account_id)
and (entry.entry_type_code <> 'INIT' and entry.post_status = 'POSTED');

原文地址:https://www.cnblogs.com/xrhou12326/p/3511612.html