Re: Informix session connect time
Posted in 1999
Topics: SQL Development & Query Writing
---- you wrote:
> In article <83r8ql$2vc$1@nnrp1.deja.com>,
> dineshjoshi@my-deja.com wrote:
> > Would any one help me in find the connect or start time of informix
> > user sessions.
>
> database sysmaster;>
> select s.sid sesssion_id,
> s.username,
> datetime( 1970-01-01 00:00:00 ) year to second +
> connected units second connected,
> pid,
> hostname[1,13],
> hex(r.flags) state
> from sysscblst s, sysrstcb r
> where s.address = r.scb
> and bitval(r.flags, '0x80000') = 1
> -- and dbinfo('sessionid') != s.sid
> order by 3
> ;
You should use the views where provided Dude. They are more likely to remain constant. Anyway, you missed out a join in the where clause. Why not try:
select sid, username,
datetime(1970-01-01 00:00:00) year to second +
connected units second connected,
pid, hostname
from syssessions
You don't have to remember the join then.
AB
----------------------------------------------------------------
Get your free email from AltaVista at http://altavista.iname.com
In article <83t7cc$41j$1@news.xmission.com>,
a_blonde@mindless.com wrote:
>
> ---- you wrote:
> > In article <83r8ql$2vc$1@nnrp1.deja.com>,
> > dineshjoshi@my-deja.com wrote:
> > > Would any one help me in find the connect or start time of
informix
> > > user sessions.
> >
> > database sysmaster;> >
> > select s.sid sesssion_id,
> > s.username,
> > datetime( 1970-01-01 00:00:00 ) year to second +
> > connected units second connected,
> > pid,
> > hostname[1,13],
> > hex(r.flags) state
> > from sysscblst s, sysrstcb r
> > where s.address = r.scb
> > and bitval(r.flags, '0x80000') = 1
> > -- and dbinfo('sessionid') != s.sid
> > order by 3
> > ;
>
> You should use the views where provided Dude. They are more likely
Agree
I don't remember the reason why I used to use this query
instead of join. I believe in some version 7.1x or 7.2x
on HP-UX I was not able to get hostname with syssessions
while join worked fine
> to remain constant. Anyway, you missed out a join in the where clause.
No, I didn't :)
> Why not try:
>
> select sid, username,
> datetime(1970-01-01 00:00:00) year to second +
> connected units second connected,
> pid, hostname
> from syssessions
Sure, this sql is better
>
> You don't have to remember the join then.
>
> AB
> ----------------------------------------------------------------
> Get your free email from AltaVista at http://altavista.iname.com
>
--
Vardan Aroustamian
vaar@geocities.com
Sent via Deja.com http://www.deja.com/
Before you buy.