Sorry if this sounds like a rather simple question..

When using the console, normally the statement outputs something similar to

X records merged

How do I capture this output into an out variable when using a merge statement in a procedure?


You can use SQL%ROWCOUNT. This return rows processed in last sql statement For example:

res number;
select 0 into res from dual;
dbms_output.put_line(sql%rowcount || ' rows selected');

This code prints 1 rows selected because you selected one row. I hope this helps

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.