Re: Session Id for program
Posted in 1998
Below is a c function you can call from 4gl to get the unix process id
(pid). This isn't the session id (which is an informix thing) but it is
also unique.
Example 4gl call:
let filename = "myfile",processid() using "<<<<<<<<"
The c function:
processid(nargs) int nargs;
{
retlong(getpid());
return(1);
}
If you really wanted you could then get the informix session id:
select sid from sysmaster:syssessions where pid = processid()
Best wishes,
----------------------------------------------------------------------
John H. Frantz Power-4gl: Extending Informix-4gl
john@rl.is http://www.rl.is/~john/pow4gl.html
Carbajal Zavaleta Daniel W. (DXA Lima3) wrote:
>
> This message is in MIME format. Since your mail reader does not understand
> this format, some or all of this message may not be legible.
>
> ------ =_NextPart_000_01BD4CD4.4715A320
> Content-Type: text/plain; charset="us-ascii"
> Content-Transfer-Encoding: 7bit
>
> It is getid( ).
>
> Daniel.
>
> -----Original Message-----
> From: Tim Schaefer [SMTP:tschaefe@mindspring.com]
> Sent: Wednesday, March 11, 1998 6:15 AM
> To: informix-list@iiug.org
> Subject: Re: Session Id for program
>
> There is a C-language library function that can make you a
> unique filename. I don't remember what it's called, but you
> can look it up in the C-language books still found in
> Many IS shops and book stores.
>
> Simply link in a C-language module with the appropriate
> function call into your 4GL program and your problem should
> be solved. To learn more about how to do this simply read
> the 4GL manuals. There are also some samples in the iiug.org
> archive, and maybe something at my site to get you started.
>
> Tim
>
> Tim Schaefer
> tschaefe@mindspring.com
> http://www.inxutil.com
> ICQ:6358805
> #include <4gl.h>
>
> SH Lim wrote in message <6e54sl$2ne$1@news.xmission.com>...
> >
> >Hi,
> > Is there a way to find out the current session-id for the 4GL
> >program that is running ? In my 4GL program, I want to assign the
> >session id for the program concatenated with userid for example for an
> >outpur file. This would uniquely define a filename which will be
> >removed.
> > Any recommendations on unique filenames conventions in 4GL output
> >files ?
> > Thanks.
> >