1

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?

1

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

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

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

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.