sql Borrado de documentos de la papelera

Posted

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了sql Borrado de documentos de la papelera相关的知识,希望对你有一定的参考价值。



declare @FRM_ID varchar(20) 
declare @QUERY varchar(1000)

SET  @FRM_ID = 657;

--Permisos de lecutra
delete from SYS_READERS  where DOC_ID in (select doc_id from SYS_DOCUMENTS where FLD_ID = 0 and FRM_ID =  @FRM_ID);
--Properties
delete from SYS_PROPERTIES where SYS_PROPERTIES.OBJ_ID  in (select doc_id from SYS_DOCUMENTS where FLD_ID = 0 and FRM_ID = @FRM_ID);
--Permisos 
delete from SYS_ACC_DOC where DOC_ID  in (select doc_id from SYS_DOCUMENTS where FLD_ID = 0 and FRM_ID = @FRM_ID);
--Adjuntos
delete from SYS_ATTACHMENTS where DOC_ID in (select doc_id from SYS_DOCUMENTS where FLD_ID = 0 and FRM_ID = @FRM_ID);
--Eventos Asincrnos trigger
delete from SYS_EVN_QUEUE where DOC_ID in (select doc_id from SYS_DOCUMENTS where FLD_ID = 0 and FRM_ID = @FRM_ID);
-- LOGS
delete from SYS_DOC_LOG where DOC_ID in (select doc_id from SYS_DOCUMENTS where FLD_ID = 0 and FRM_ID = @FRM_ID);
-- SYS_DOCUMENTS
delete from SYS_DOCUMENTS where  FLD_ID = 0 and FRM_ID = @FRM_ID;
--Execute 
SET @QUERY = 'delete from SYS_FIELDS_' + @FRM_ID + ' WHERE DOC_ID IN (select doc_id from SYS_DOCUMENTS where FLD_ID = 0 and FRM_ID ='+ @FRM_ID+ ')';

Exec (@QUERY)

以上是关于sql Borrado de documentos de la papelera的主要内容,如果未能解决你的问题,请参考以下文章

markdown Estructura de un documento WSDL

vbscript Comparar campos de dos documentos de Gestar con el mismo form logicamente

markdown Ejemplo documento Cacher

markdown Documentos canonicos

javascript agregar javascript en un documento

php insertaArchivo PHP archivos documento archivo insertaArchivos listaArchivos listado