Re: How can I trace SQL executed by forms application

From: Jim Smith <jim_at_jimsmith.demon.co.uk>
Date: 1996/10/30
Message-ID: <W2EcTEAd5zdyEwJF_at_jimsmith.demon.co.uk>#1/1


In article <32762879.41C6_at_nynexst.com>, Steve Rothkin <srothkin_at_nynexst.com> writes
>Is there any way I can capture a log/trace of ALL the SQL executed by an
>Oracle Forms 4.5 application (both what I have in my triggers and what
>is done automatically by forms)?
>
If you issue 'alter session set sql_trace true' in a pre-form trigger (and switch it off afterwards) that should do the trick.

Unfortunately, 'alter session ' counts as DDL and can't be issued directly in PL/SQL so you will have to use the DBMS_SQL package to implement this,

From memory :

declare

cursor_id integer;

begin

cursor_id:=dbms_sql.open_cursor;

dbms_sql.parse(cursor_id,'alter session set sql_trace true'); -- with ddl the parse stage executes as well

dbms_sql.close_cursor(cursor_id);

end;

I useo stored procedures (tron,troff) to enable and disable tracing which can be called from any tool. (or you could put them in a forms PL/SQL library

Please use comp.databases.oracle.tools for forms related questions. This group is being phased out.

-- 
Jim Smith
Received on Wed Oct 30 1996 - 00:00:00 CET

Original text of this message