If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > Database Server Software > Informix > session id for temporary tables

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 10-14-04, 08:03
jacdym jacdym is offline
Registered User
 
Join Date: Oct 2004
Posts: 4
session id for temporary tables

How can I get session id for temporary tables?

I can find temporary tables and owners from query:

select t.dbsname, t.tabname, t.owner
from sysmaster:systabnames t, sysmaster:sysptnhdr p
where t.partnum = p.partnum
and bitval(p.flags,32) = 1

But where is session id?

Jacek
Reply With Quote
  #2 (permalink)  
Old 10-15-04, 11:32
gurey gurey is offline
Registered User
 
Join Date: Aug 2003
Location: Argentina
Posts: 780
Hi,

Please test with this from sysmaster:

SELECT substr(n.dbsname,1,15) type,
substr(n.owner,1,15) users,
substr(n.tabname,1,18) table,
substr(dbinfo('DBSPACE', i.ti_partnum),1,15) dbspace,
round(i.ti_nptotal*2,0) kb
FROM systabnames n, systabinfo i
WHERE (bitval(i.ti_flags, 32) = 1
OR bitval(i.ti_flags, 64) = 1
OR bitval(i.ti_flags, 128) = 1)
AND i.ti_partnum = n.partnum
into temp ggtmp with no log;
SELECT type[1,12], users, table, dbspace[1,12], kb
from ggtmp
order by 1,2,3,4

Gustavo.
Reply With Quote
  #3 (permalink)  
Old 10-18-04, 07:08
jacdym jacdym is offline
Registered User
 
Join Date: Oct 2004
Posts: 4
Your example query don't retrive sesion id for temporary tables

Jacek
Reply With Quote
  #4 (permalink)  
Old 10-23-04, 12:57
vpshriyan vpshriyan is offline
Registered User
 
Join Date: Nov 2003
Location: Mumbai, India
Posts: 92
Hi,

Session id can be retrieved as:
select dbinfo('sessionid') from systables where tabid=1;

Hence:
select t.dbsname, t.tabname, t.owner, dbinfo('sessionid')
from sysmaster:systabnames t, sysmaster:sysptnhdr p
where t.partnum = p.partnum
and bitval(p.flags,32) = 1

Regards,
Shriyan
Reply With Quote
  #5 (permalink)  
Old 10-26-04, 09:12
jacdym jacdym is offline
Registered User
 
Join Date: Oct 2004
Posts: 4
It's not working correctly. This query retrieve my current sesion id.
I need sesion id for another users who create temporary tables.
I need list of sesion id for active users who have created temporary tables with special names.

Jacek
Reply With Quote
  #6 (permalink)  
Old 10-26-04, 09:38
jacdym jacdym is offline
Registered User
 
Join Date: Oct 2004
Posts: 4
I explain what is my problem

One company with about 300 customers use old and new version client/server application. Administrators don't know who use old and who use new version.
They would like to block database connection for customers who use old software. Old software always create temporary table called "tmp_param".
I would like to write server process which control who and when temp table "tmp_param" was created. If this table exist the process disconnect application (connected by session id) from database server.

Jacek
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On