RE: Sysmas ter - Tabe las Tempor iso-8859-1?QE1ria
Posted in 2014
Topics: SQL Development & Query Writing
Fernando,
I just tried to show you what was the environment that I was working. I know
that I can't keep the session alive without a program running. But I was
trying to show you why I needed that.
This program developed, alows to user write into a WEB intarface a query
(including create temporarytable). So, the developer never knows what the
temporary table name. I knew about DROP TABLE IF EXISTS but it's useless in
this case.
I'm curious, because, I always knew that onstat's output results is the same
that we can get when we query the sysmaster database. And onstat -g sql
"knows" which tables belongs to a session. I though that was one table (or
more) that we could join the sid with tamporary table id.
But thanks any way
André Luiz Rufino
> To: ids@iiug.org
> From: domusonline@gmail.com
> Subject: Re: Sysmaster - Tabelas Temporária [32271]
> Date: Mon, 20 Jan 2014 12:20:21 -0500
>
> I'm not absolutely sure I got your requirement correctly... You say:
>
> "a program that runs once .... keep the session alive":
> You cannot keep a session alive without a program running.
>
> Then you say:
> "I need to drop temporary tables (if they exist)"
> Ok... Just DROP them and capture the error... of if you're using 11.70 do
> "DROP TABLE IF EXISTS..."
>
> What you're requesting (gathering the current temporary tables of you
> session) is not possible currently.
> There is already a feature request for it, created by Cesar Martins I
> believe, so please vote for it, if it suites your needs:
>
> http://www.ibm.com/developerworks/rfe/execute?use_case=viewRfe&CR_ID=36245
>
> We're still missing a feature for knowng who is using the temporary tables
> which should be linked to this one I believe.
> Regards
>
> On Mon, Jan 20, 2014 at 4:58 PM, André Luiz Rufino
> <andre_rufino@msn.com>wrote:
>
> > Hi folks,
> > I need to write a program that must run once, create some temporary tables
> > and
> > keep the session alive. The user must to be able to run again, without
> > close
> > the session. I need to drop temporary tables(if it deos exist) and recreate
> > then again.
> > Does anybody knows what sysmaster table can I access to find which
> > temporary
> > table belongs to my session.
> > In others words, where are the temporary tables joined with session id ?
> > Thanks a lot,
> > André Luiz Rufino
> >
> >
> >
> >
>
*******************************************************************************
> > Forum Note: Use "Reply" to post a response in the discussion forum.
> >
> >
>
> --
> Fernando Nunes
> Portugal
>
> http://informix-technology.blogspot.com
> My email works... but I don't check it frequently...
>
> --001a11337576f74bf904f06a1a79
>
>
>
*******************************************************************************
> Forum Note: Use "Reply" to post a response in the discussion forum.
>
I see....
Unfortunately not everything you can do with onstat can be done with SQL.
The options you have:
1- Open a new session for every query. I would consider this a last resort
as it's not a good principle.
2- Use the SQL Admin API to run the onstat -g ses and parse the output.
This may not be trivial, but it should be possible
3- Parse the user input for "CREATE TEMP TABLE..." and "INTO TEMP...." to
extract the temp table names and drop it when the query finishes (but how
do you know it finishes and that the user will not run another that
requires it?)
4- Catch the error "table already exists" and then drop it... but the
session would accumulate temporary tables forever
Regards
On Tue, Jan 21, 2014 at 10:25 AM, André Luiz Rufino
<andre_rufino@msn.com>wrote:
> Fernando,
> I just tried to show you what was the environment that I was working. I
> know
> that I can't keep the session alive without a program running. But I was
> trying to show you why I needed that.
> This program developed, alows to user write into a WEB intarface a query
> (including create temporarytable). So, the developer never knows what the
> temporary table name. I knew about DROP TABLE IF EXISTS but it's useless in
> this case.
> I'm curious, because, I always knew that onstat's output results is the
> same
> that we can get when we query the sysmaster database. And onstat -g sql
> "knows" which tables belongs to a session. I though that was one table (or
> more) that we could join the sid with tamporary table id.
> But thanks any way
> André Luiz Rufino
> > To: ids@iiug.org
> > From: domusonline@gmail.com
> > Subject: Re: Sysmaster - Tabelas Temporária [32271]
> > Date: Mon, 20 Jan 2014 12:20:21 -0500
> >
> > I'm not absolutely sure I got your requirement correctly... You say:
> >
> > "a program that runs once .... keep the session alive":
> > You cannot keep a session alive without a program running.
> >
> > Then you say:
> > "I need to drop temporary tables (if they exist)"
> > Ok... Just DROP them and capture the error... of if you're using 11.70 do
> > "DROP TABLE IF EXISTS..."
> >
> > What you're requesting (gathering the current temporary tables of you
> > session) is not possible currently.
> > There is already a feature request for it, created by Cesar Martins I
> > believe, so please vote for it, if it suites your needs:
> >
> >
> http://www.ibm.com/developerworks/rfe/execute?use_case=viewRfe&CR_ID=36245
> >
> > We're still missing a feature for knowng who is using the temporary
> tables
> > which should be linked to this one I believe.
> > Regards
> >
> > On Mon, Jan 20, 2014 at 4:58 PM, André Luiz Rufino
> > <andre_rufino@msn.com>wrote:
> >
> > > Hi folks,
> > > I need to write a program that must run once, create some temporary
> tables
> > > and
> > > keep the session alive. The user must to be able to run again, without
> > > close
> > > the session. I need to drop temporary tables(if it deos exist) and
> recreate
> > > then again.
> > > Does anybody knows what sysmaster table can I access to find which
> > > temporary
> > > table belongs to my session.
> > > In others words, where are the temporary tables joined with session id
> ?
> > > Thanks a lot,
> > > André Luiz Rufino
> > >
> > >
> > >
> > >
> >
>
>
*******************************************************************************
> > > Forum Note: Use "Reply" to post a response in the discussion forum.
> > >
> > >
> >
> > --
> > Fernando Nunes
> > Portugal
> >
> > http://informix-technology.blogspot.com
> > My email works... but I don't check it frequently...
> >
> > --001a11337576f74bf904f06a1a79
> >
> >
> >
>
>
*******************************************************************************
> > Forum Note: Use "Reply" to post a response in the discussion forum.
> >
>
>
>
>
*******************************************************************************
> Forum Note: Use "Reply" to post a response in the discussion forum.
>
>
--
Fernando Nunes
Portugal
http://informix-technology.blogspot.com
My email works... but I don't check it frequently...
--089e0149ca3a32bdec04f0790475
Related threads
- Posting from the Informix-list
- Migrating from IDS 9.40.UC6 to 11.50.UC3
- Ip for a network session
- questions onstat -g