Control SQL Query

Everything about Control-M Enterprise Manager Server installation or setup.
Post Reply
User avatar
nbarr007
Nouveau
Nouveau
Posts: 22
Joined: 30 Nov 2007 12:00

Control SQL Query

Post by nbarr007 » 03 May 2011 11:59

I have created this query to report the start, end and duration of a group of jobs on a daily basis.

When I run the query I get no output. Could someone please check and advise.

I am running version 6.04

select distinct JOBNAME, schedtab
, to_char(to_timestamp(trim(timestmp)
, 'YYYYMMDDHH24MISS') - numtodsinterval(elaptime / 100
, 'SECOND'), 'YYYY-MM-DD HH24:MI:SS') as start_time
, to_char(to_date(trim(timestmp), 'YYYYMMDDHH24MISS')
, 'YYYY-MM-DD HH24:MI:SS') as end_time
, substr(to_char(numtodsinterval(elaptime / 100, 'SECOND')
, 'HH24:MI'), 12, 8) as duration
from CMR_RUNINF
where timestmp=to_char(SYSDATE,'YYYY-MM-DD HH24:MI:SS')
and schedtab like '%GHOIT%'
order by duration desc

User avatar
philmalmaison
Nouveau
Nouveau
Posts: 1148
Joined: 08 Jun 2007 12:00
Location: Ile de France

Post by philmalmaison » 04 May 2011 10:40

Hi,
Are you waiting the necessary time for the answer before to stop it (by ctrl-C ?)

Regards,
philmalmaison

User avatar
nbarr007
Nouveau
Nouveau
Posts: 22
Joined: 30 Nov 2007 12:00

Post by nbarr007 » 04 May 2011 12:06

Hi Phil

I am using PL/SQL Developer to run the query and all I get is the column headings when I execute, but no data

rgd's

Norman

User avatar
th_alejandro
Nouveau
Nouveau
Posts: 188
Joined: 26 Nov 2008 12:00
Location: Bogotá

Hi

Post by th_alejandro » 05 May 2011 12:39

DO not use this table, connect to EMUSER database (not CTM). Localize your active net name from :
SELECT active_net_name INTO vactive_netname
FROM emuser.comm ;
with this vactive_netname, localize the tabla X${vactive_netname}JOB and make you select on this table.

User avatar
gglau
Nouveau
Nouveau
Posts: 317
Joined: 13 Jun 2007 12:00

Post by gglau » 05 May 2011 6:10

where timestmp=to_char(SYSDATE,'YYYY-MM-DD HH24:MI:SS')
There isn't possibly a job with the exact timestamp when the SQL executes. You may want to use < instead of =

User avatar
philmalmaison
Nouveau
Nouveau
Posts: 1148
Joined: 08 Jun 2007 12:00
Location: Ile de France

Post by philmalmaison » 09 May 2011 4:08

hi,
You can easilly used the ctmruninf

Regards,
Philmalmaison

Post Reply