/* Formatted on 2018/3/15 10:33:14 (QP5 v5.256.13226.35538) */

--发票

CREATE TABLE bak.ap_invoices_all_110707

AS

SELECT *

FROM ap_invoices_all aia

WHERE aia.invoice_id IN (90490, 90333);

--发票行

CREATE TABLE bak.ap_invoice_lines_110707

AS

SELECT *

FROM ap_invoice_lines_all ala

WHERE ala.invoice_id IN (90490, 90333);

--分配

CREATE TABLE bak.ap_invoice_dist_110707

AS

SELECT *

FROM ap_invoice_distributions_all aid

WHERE aid.invoice_id = 90490;

--计划付款

CREATE TABLE bak.ap_payment_schedules_110707

AS

SELECT *

FROM ap_payment_schedules_all p

WHERE p.invoice_id IN (90490, 90333);

--暂挂

CREATE TABLE bak.ap_holds_110707

AS

SELECT *

FROM ap_holds_all h

WHERE h.invoice_id = 90490;

--付款行

CREATE TABLE bak.ap_invoice_payments_110707

AS

SELECT *

FROM ap_invoice_payments_all aip

WHERE aip.invoice_id = 90333;

--付款头

CREATE TABLE bak.ap_checks_110707

AS

SELECT *

FROM ap_checks_all ac

WHERE ac.check_id = 64863;

--分录事件

CREATE TABLE bak.xla_trans_entities_110707

AS

SELECT *

FROM xla.xla_transaction_entities xte

WHERE xte.source_id_int_1 IN (90490, 90333)

AND xte.security_id_int_1 = 81

AND application_id = 200;

INSERT INTO bak.xla_trans_entities_110707

SELECT *

FROM xla.xla_transaction_entities xte

WHERE xte.source_id_int_1 IN (64863)

AND xte.security_id_int_1 = 81

AND application_id = 200;

--分录头

CREATE TABLE bak.xla_ae_headers_110707

AS

SELECT *

FROM xla.xla_ae_headers xah

WHERE xah.entity_id IN (9556541, 9554363);

INSERT INTO bak.xla_ae_headers_110707

SELECT *

FROM xla.xla_ae_headers xah

WHERE xah.entity_id IN (9554366);

--会计事件

CREATE TABLE bak.xla_events_110707

AS

SELECT *

FROM xla_events xe

WHERE xe.event_id IN (SELECT event_id

FROM xla.xla_ae_headers xah

WHERE xah.entity_id IN (9556541, 9554363));

INSERT INTO bak.xla_events_110707

SELECT *

FROM xla_events xe

WHERE xe.event_id IN (SELECT event_id

FROM bak.xla_ae_headers_110707 xah

WHERE xah.entity_id IN (9554366));

--分录行

CREATE TABLE bak.xla_ae_lines_110707

AS

SELECT *

FROM xla.xla_ae_lines xal

WHERE xal.ae_header_id IN (14101317, 14103708, 14299824);

INSERT INTO bak.xla_ae_lines_110707

SELECT *

FROM xla.xla_ae_lines xal

WHERE xal.ae_header_id = 14101322;

--日记账导入参考

CREATE TABLE bak.gl_import_references_110707

AS

SELECT *

FROM gl.gl_import_references gr

WHERE gr.gl_sl_link_id IN (SELECT gl_sl_link_id

FROM xla.xla_ae_linesxal

WHERE xal.ae_header_id IN (14101317, 14103708, 14299824));

INSERT INTO bak.gl_import_references_110707

SELECT *

FROM gl.gl_import_references gr

WHERE gr.gl_sl_link_id IN (25174221, 25174222);

--日记账头

CREATE TABLE bak.gl_je_headers_110707

AS

SELECT *

FROM gl_je_headers gjh

WHERE gjh.je_header_id IN (SELECT je_header_id

FROM gl.gl_import_references gr

WHERE gr.gl_sl_link_id IN (SELECT gl_sl_link_id

FROM xla.xla_ae_linesxal

WHERE xal.ae_header_id IN (14101317, 14103708, 14299824)));

INSERT INTO bak.gl_je_headers_110707

SELECT *

FROM gl_je_headers gjh

WHERE gjh.je_header_id = 5553330;

--日记账行

CREATE TABLE bak.gl_je_lines_110707

AS

SELECT *

FROM gl_je_lines gjl

WHERE gjl.je_header_id IN (SELECT je_header_id

FROM gl.gl_import_references gr

WHERE gr.gl_sl_link_id IN (SELECT gl_sl_link_id

FROM xla.xla_ae_linesxal

WHERE xal.ae_header_id IN (14101317, 14103708, 14299824)));

INSERT INTO bak.gl_je_lines_110707

SELECT *

FROM gl_je_lines gjl

WHERE gjl.je_header_id = 5553330;

--日记帐批

CREATE TABLE bak.gl_je_batches_110707

AS

SELECT *

FROM gl_je_batches gjb

WHERE gjb.je_batch_id IN (SELECT je_batch_id

FROM gl.gl_import_references gr

WHERE gr.gl_sl_link_id IN (SELECT gl_sl_link_id

FROM xla.xla_ae_lines xal

WHERE xal.ae_header_id IN (14101317, 14103708, 14299824)));

--发票

DELETE FROM ap_invoices_all aia

WHERE aia.invoice_id IN (90490, 90333);

--发票行

DELETE FROM ap_invoice_lines_all ala

WHERE ala.invoice_id IN (90490, 90333);

--分配

DELETE FROM ap_invoice_distributions_all aid

WHERE aid.invoice_id = 90490;

--计划付款

DELETE FROM ap_payment_schedules_all p

WHERE p.invoice_id IN (90490, 90333);

--暂挂

DELETE FROM ap_holds_all h

WHERE h.invoice_id = 90490;

--付款行

DELETE FROM ap_invoice_payments_all aip

WHERE aip.invoice_id = 90333;

--付款头

DELETE FROM ap_checks_all ac

WHERE ac.check_id = 64863;

--分录事件

DELETE FROM xla.xla_transaction_entities xte

WHERE xte.source_id_int_1 IN (90490, 90333)

AND xte.security_id_int_1 = 81

AND application_id = 200;

DELETE FROM xla.xla_transaction_entities xte

WHERE xte.source_id_int_1 IN (64863)

AND xte.security_id_int_1 = 81

AND application_id = 200;

--分录头

DELETE FROM xla.xla_ae_headers xah

WHERE xah.entity_id IN (9556541, 9554363);

DELETE FROM xla.xla_ae_headers xah

WHERE xah.entity_id IN (9554366);

--会计事件

DELETE FROM xla_events xe

WHERE xe.event_id IN (SELECT event_id

FROM bak.xla_ae_headers_110707 xah

WHERE xah.entity_id IN (9556541, 9554363));

DELETE FROM xla_events xe

WHERE xe.event_id IN (SELECT event_id

FROM bak.xla_ae_headers_110707 xah

WHERE xah.entity_id IN (9554366));

--分录行

DELETE FROM xla.xla_ae_lines xal

WHERE xal.ae_header_id IN (14101317, 14103708, 14299824);

DELETE FROM xla.xla_ae_lines xal

WHERE xal.ae_header_id = 14101322;

--日记账导入参考

DELETE FROM gl.gl_import_references gr

WHERE gr.gl_sl_link_id IN (SELECT gl_sl_link_id

FROM bak.xla_ae_lines_110707 xal

WHERE xal.ae_header_id IN (14101317, 14103708, 14299824));

DELETE FROM gl.gl_import_references gr

WHERE gr.gl_sl_link_id IN (25174221, 25174222);

--日记账头

DELETE FROM gl_je_headers gjh

WHERE gjh.je_header_id IN (SELECT je_header_id

FROM bak.gl_import_references_110707 gr

WHERE gr.gl_sl_link_id IN (SELECT gl_sl_link_id

FROM bak.xla_ae_lines_110707 xal

WHERE xal.ae_header_id IN (14101317, 14103708, 14299824)));

DELETE FROM gl_je_headers gjh

WHERE gjh.je_header_id = 5553330;

--日记账行

DELETE FROM gl_je_lines gjl

WHERE gjl.je_header_id IN (SELECT je_header_id

FROM bak.gl_import_references_110707 gr

WHERE gr.gl_sl_link_id IN (SELECT gl_sl_link_id

FROM bak.xla_ae_lines_110707 xal

WHERE xal.ae_header_id IN (14101317, 14103708, 14299824)));

DELETE FROM gl_je_lines gjl

WHERE gjl.je_header_id = 5553330;

--日记帐批

DELETE FROM gl_je_batches gjb

WHERE gjb.je_batch_id = 5007897;

SELECT ROWID, gjb.*

FROM gl_je_batches gjb

WHERE gjb.je_batch_id IN (SELECT je_batch_id

FROM bak.gl_import_references_110707 gr

WHERE gr.gl_sl_link_id IN (SELECT gl_sl_link_id

FROM bak.xla_ae_lines_110707 xal

WHERE xal.ae_header_id IN (14101317, 14103708, 14299824)));

删除 AP 发票相关脚本的更多相关文章

  1. EBS中后台AP发票审批脚本

    Declare    l_Hold_Count Number;    l_Funds_Code Varchar2(30);      l_Approve_Status Varchar2(120); B ...

  2. windows下自动删除过期文件的脚本

    windows下自动删除过期文件的脚本 前言: 比如日志文件每天都产生,时间长了就会有很大的一堆垃圾.整理一下 定时删除文件的方法. 正文: Windows: 定时删除tomcat日志和缓存.可以保留 ...

  3. shell基础、变量、相关脚本

    目录 一.shell基础 书写规范 引号 配置文件 read交互 脚本调式 小节总结 二.变量 变量类型 位置变量 状态变量 替换和删除 变量补充 变量运算 小节总结 三.相关脚本面试题 统计hist ...

  4. 关于C#和ASP.NET中对App.config和Web.config文件里的[appSettings]和[connectionStrings]节点进行新增、修改、删除和读取相关的操作

    最近我做的一些项目,经常需要用到对应用程序的配置文件操作,如app.config和web.config的配置文件,特别是对配置文件中的[appSettings]和[connectionStrings] ...

  5. 有关UITableViewCell的侧滑删除以及使用相关大神框架MGSwipeTableCell遇到的小问题

    提起笔,却不知道从何写起了,今天一整天都耗费在了这个可能根本不算是问题的小问题上,至今仍有一种蛋蛋的忧桑..(噢,不是提笔,是键盘手T_T) 表格视图在项目中就像是每日的家常便饭,在cell上添加侧滑 ...

  6. android6.0SDK 删除HttpClient的相关类的解决方法

    本文转载自博客:http://blog.csdn.net/yangqingqo/article/details/48214865 android6.0SDK中删除HttpClient的相关类的解决方法 ...

  7. 又一次发现Oracle太美之awr相关脚本简介

    又一次发现Oracle太美之awr相关脚本简介 大家知道在$ORACLE_HOME/rdbms/admin下,有例如以下的相关脚本(我的环境为11.2.0.4.2): [oracle@rh64 ~]$ ...

  8. ELK批量删除索引 及 相关操作命令 - 运维小结

    线上部署了ELK+Redis日志分析平台环境, 随着各类日志数据源源不断的收集, 发现过了一段时间之后, ELK查看会原来越慢, 重启elasticsearch服务器节点之前同步时间也会很长,  这是 ...

  9. Oracle性能诊断艺术-相关脚本说明

    第二章 bind_variables.sql     展示怎样绑定变量及何时绑定变量会导致游标共享 bind_variables_peeking.sql  展示绑定变量窥测的优缺点 selectivi ...

随机推荐

  1. zabbix报警Too many processes on zabbix server

    zabbix大量报警,运行进程过多,但实际有部分机器可以忽略,需要关闭相关的报警 Configuration-->Templates找到Template_Linux点该行的 Triggers选择 ...

  2. Kaggle大数据竞赛平台入门

    Kaggle大数据竞赛平台入门 大数据竞赛平台,国内主要是天池大数据竞赛和DataCastle,国外主要就是Kaggle.Kaggle是一个数据挖掘的竞赛平台,网站为:https://www.kagg ...

  3. 大数据统计分析平台之一、Kafka单机搭建

    1.zookeeper搭建 Kafka集群依赖zookeeper,需要提前搭建好zookeeper 单机模式(7步)(集群模式进阶请移步:http://blog.51cto.com/nileader/ ...

  4. DedeCMS常见问题和技巧

    1: dedecms 访问空白(织梦如何显示详细错误) 我们在使用织梦的时候,有的时候会遇到访问空白的情况,尤其是再刚刚搬家之后,织梦会出现访问空白或者返给您一个500的友好界面错误,遇到这种情况该怎 ...

  5. T-SQL语句4

    一.插入数据 1.insert语句介绍 insert into table_name(column1,column2……column)values(value1,value2,……valueN)//c ...

  6. 7-12 The Rotation Game IDA*

    状态搜索题目  一开始打算用bfs  但是图给的不是矩形图  有点难以下手 参考了 lrj    将图上所有的点进行标号  直接一个一维数组就解决了图的问题  并且明确了每个点的标号  处理起来十分方 ...

  7. java文件压缩与解压

    感谢“zlex.dongliang@gmail.com”.主要代码如下: import java.io.BufferedInputStream; import java.io.File; import ...

  8. 访问url下载文件----python

    工作上有时候有需求,会下载pdf,doc,zip等文件,可以用以下方法,推荐使用第一种 下载文件: import urllib import urllib2 import requests url = ...

  9. redis 持久化的两种方式

    一:快照模式 或许在用Redis之初的时候,就听说过redis有两种持久化模式,第一种是SNAPSHOTTING模式,还是一种是AOF模式,而且在实战场景下用的最多的 莫过于SNAPSHOTTING模 ...

  10. 016.Zabbix聚合监控

    一 Zabbix监控机汇总计算 用Calcuated Items可以对Items进行汇总计算,如求磁盘总容量.网络流量,只依赖于Zabbix-Server,与Zabbix-Agent和proxy无关. ...