Toad World® Forums

COL command in Toad - Newbie questions

I’m trying to run the following in Toad SQL Editor…it keeps squawking about the “col” command. Can you not format columns in SQL Editor, or am I just doing something incorrectly?

Thanks from a newbie.

RW

/set lines 155/
col execs for 999,999,999
col avg_etime for 999,999.999
col avg_lio for 999,999,999.9
col begin_interval_time for a30
col node for 99999
/break on plan_hash_value on startup_time skip 1/
select ss.snap_id, ss.instance_number node, begin_interval_time, s.sql_id, s.plan_hash_value,
nvl(executions_delta,0) execs,
(elapsed_time_delta/decode (nvl(executions_delta,0),0,1,executions_delta))/1000000 avg_etime,
(buffer_gets_delta/decode (nvl(buffer_gets_delta,0),0,1,executions_delta)) avg_lio, s.sql_profile, sq.sql_text
from DBA_HIST_SQLSTAT S, DBA_HIST_SNAPSHOT SS, v$sql SQ

where s.sql_id = sq.sql_id and
ss.snap_id = S.snap_id
and ss.instance_number = S.instance_number
and executions_delta > 0
–and begin_interval_time > ‘12/06/2017 0:00:00.000 AM’

order by 1, 2, 3
/

You have to run this as a script (F5). Then it should work fine for you.

Hi

I’m running it as a script using F5 that’s the problem.

spell out column

On Dec 7, 2017 7:46 AM, “colin.west” bounce-colinwest@toadworld.com wrote:

RE: COL command in Toad - Newbie questions

Reply by colin.west
Hi

I’m running it as a script using F5 that’s the problem.

To reply, please reply-all to this email.

Stop receiving emails on this subject.

Or Unsubscribe from Toad for Oracle Forum notifications altogether.

Toad for Oracle - Discussion Forum

Flag this post as spam/abuse.

Or you can just forget all of those COL, SET, BREAK lines and just run the SELECT statement by itself with F9. Toad will separate the data into nice columns for you.