I have a problem that I am already thinking of as a lack of faith.
I have a proc that performs a series of inserts and updates . It goes through the first insert and the first update and performs what is proposed. In the inserts , the insert clause is apparently ignored in proc . The select for the insert in question returns data, if I take the block and run separately in another window it effectively does the insert and, a DBMS_OUTPUT in the proc below every insert , you can see that it goes there normally, it just does not do what is proposed.
In summary, it runs the first two commands and the others it ignores, even passing them.
Does anyone have any idea what this might be?
As an example, follows a proc fragment and the DBMS output:
- The previous command executes an insert that effectively populates the order table correctly with the passed parameters
--After we have this insert followed by other inserts in other tables, but which are similar
- At the end of each insert, I put a DBMS_OUTPUT, which returns the message of having passed by there
--Pushing each insert and running separately, they work, but in proc not
begin
INSERT INTO BANCO.PED_COMPL_PEDIDO (
EMPRESA,
PEDIDO,
DAT_HOR_INCLUSAO,
USUARIO_INCLUSAO,
PORTADOR,
TIP_PORTADOR,
FORMA_PAGTO,
FINALIDADE_USO,
TIP_DESC,
EMISSAO_PEDIDO,
PROCESSO_EXPORT,
EMPRESA_VENDA
)
select
'FF' ,--EMPRESA
pedidos.num_pedido, --PEDIDO
sysdate, --DAT_HOR_INCLUSAO
'user ', --USUARIO_INCLUSAO
'', --PORTADOR
'', --TIP_PORTADOR
'', --FORMA_PAGTO
'', --FINALIDADE_USO
'', --TIP_DESC
'', --EMISSAO_PEDIDO
'', --PROCESSO_EXPORT
'' --EMPRESA_VENDA
from BANCO.pedidos
where pedidos.cod_empresa= 'FF'
and pedidos.dat_pedido= vDataEmissao
and pedidos.NUM_PEDIDO_CLI = idEntrega
and pedidos.num_pedido not in (select pedido from BANCO.PED_COMPL_PEDIDO
where usuario_inclusao='clientUser '
and DAT_HOR_INCLUSAO >=(sysdate-60));
DBMS_OUTPUT.PUT_LINE('Passou pela PED_COMPL_PEDIDO');
commit;
DBMS_OUTPUT.PUT_LINE('-----------------------------');
DBMS_OUTPUT.PUT_LINE(vDataEmissao || ' Data emissão');
DBMS_OUTPUT.PUT_LINE(idEntrega || ' id Entrega');
DBMS_OUTPUT.PUT_LINE('-----------------------------');
end;
The output of the DBMS was this:
Passed by PED_COMPL_PEDIDO
30/10/17 Issue date
27583545 id Delivery