How to redirect 'dbms_output.put_line content' to log file from a TimesTen Stored Procedure

See the sample Timesten procedure below.

CREATE OR REPLACE PROCEDURE test_proc(employee_id IN NUMBER) AS
salary NUMBER;
BEGIN
SELECT emp_sal INTO salary FROM employee where emp_id = employee_id;
DBMS_OUTPUT.PUT_LINE('Employee Id:' || employee_id || ' Annual Income:' || salary*12);
END;
/

If I call the procedure from Command line interface(ttisql), dbms_output.put_line logs gets printed there only. But I want to collect such debug logs to somewhere else in a log file. Whenever procedure get executed it should append these content to a file. Is there any possible way to do that?

Answers


If you are calling your procedure from ttisql as you've said you can use spool filepath and spool off to log any messages appeared on the screen. To append new information to the already existed log file just use APPEND option after filepath

spool c:\logfile.log append

Need Your Help

TwitterWidget within SilverStripe

javascript jquery twitter document.write silverstripe

I am trying to integrate TwitterWidget within SilverStripe.

Idiomatic way to get first element of a lazy seq in clojure

clojure lazy-sequences

When processing each element in a seq I normally use first and rest.