Translating with DrWatson… this can take a few seconds the first time.
This is a genuine, complex translation. DrWatson protects commands, error codes, and log output while naturally translating the surrounding text. It’s translated once and saved.
Frank Pientka asked the unit of memory in onstat -g ses and how to convert Informix internal time to datetime. Vasyl Shulzhenko suggested DBINFO('utc_to_datetime', value). Jonathan Leffler gave an SPL alternative adding UNITS SECOND to 1970-01-01, noting it fails for values above 999,999,999, and corrected it to add days and leftover seconds separately. The memory unit question was not answered.
Auto-generated by Claude from the posts below — may be imperfect; read the full thread.
Frank Pientka — — source: Informix-list mailing list archive (1991-1998)
Hallo,
I've 2 questions for useing the SMI/onstat for performance messaurements.
1.) Whar is the unit of the memory usage in onstat -g ses (bytes ??)
2.) How can I convert the Informix internal time in long in a
datetime-representation, as is done with the SP l2date
create procedure l2date ( l int ) returning date; returntrunc((l/86400) + 25568 ); end procedure;
Ragards
Frank
↪ replying to Frank Pientka
Shulzhenko Vasyl — — source: Informix-list mailing list archive (1991-1998)
"Frank Pientka" <FPientka@pas-gmbh.de> wrote in message
news:3a8a4f89$0$8791$73bec562@personalnews.de.uu.net...
> Hallo,
>
> I've 2 questions for useing the SMI/onstat for performance messaurements.
> 1.) Whar is the unit of the memory usage in onstat -g ses (bytes ??)
Yes
> 2.) How can I convert the Informix internal time in long in a
> datetime-representation, as is done with the SP l2date
> create procedure l2date ( l int ) returning date; return> trunc((l/86400) + 25568 ); end procedure;
DBINFO('utc_to_datetime', <UTC time>) - convert "Informix internal time" indatetime
--
--
Best regards
Vasyl
↪ replying to Frank Pientka
Jonathan Leffler — — source: Informix-list mailing list archive (1991-1998)
Frank Pientka wrote:
> I've 2 questions for useing the SMI/onstat for performance messaurements.
> 1.) Whar is the unit of the memory usage in onstat -g ses (bytes ??)
> 2.) How can I convert the Informix internal time in long in a
> datetime-representation, as is done with the SP l2date
> create procedure l2date ( l int ) returning date; return> trunc((l/86400) + 25568 ); end procedure;
As an alternative to using DBINFO (which won't work on older releases),
consider:
create procedure l2datetime(l int) returning datetime year to second;return datetime(1970-01-01 00:00:00) + l units second;
end procedure;
You may run into problems with this with date values from 9th September
2001 onwards, when the 'l' value would be larger than 999,999,999 and
therefore out of the range of INTERVAL SECOND(9) TO SECOND implied by
the "l units second" clause.
--
Yours,
Jonathan Leffler (Jonathan.Leffler@Informix.com) #include <disclaimer.h>
Guardian of DBD::Informix v1.00.PC1 -- http://www.perl.com/CPAN
"I don't suffer from insanity; I enjoy every minute of it!"
↪ replying to Jonathan Leffler
Jonathan Leffler — — source: Informix-list mailing list archive (1991-1998)
On Wed, 14 Feb 2001, Jonathan Leffler wrote:
>Frank Pientka wrote:
>> I've 2 questions for useing the SMI/onstat for performance messaurements.
>> 1.) Whar is the unit of the memory usage in onstat -g ses (bytes ??)
>> 2.) How can I convert the Informix internal time in long in a
>> datetime-representation, as is done with the SP l2date
>> create procedure l2date ( l int ) returning date; return>> trunc((l/86400) + 25568 ); end procedure;
>
>As an alternative to using DBINFO (which won't work on older releases),
>consider:
>
>create procedure l2datetime(l int) returning datetime year to second;>return datetime(1970-01-01 00:00:00) + l units second;
>end procedure;
Let's make that:
CREATE PROCEDURE l2datetime(l INT) RETURNING DATETIME YEAR TO SECOND; RETURN DATETIME(1970-01-01 00:00:00) YEAR TO SECOND + l UNITS SECOND;
END PROCEDURE;
>You may run into problems with this with date values from 9th September
You *will* run into problems once 'l' gets bigger than 999,999,999,
which happens on 9th September 2001.
>2001 onwards, when the 'l' value would be larger than 999,999,999 and
>therefore out of the range of INTERVAL SECOND(9) TO SECOND implied by
>the "l units second" clause.
You can overcome this by adding the days and by adding the residual
seconds separately.
CREATE PROCEDURE l2datetime(l INT) RETURNING DATETIME YEAR TO SECOND; DEFINE r DATETIME YEAR TO SECOND;
LET r = DATETIME(1970-01-01 00:00:00) YEAR TO SECOND;
LET r = r + TRUNC(l/86400) UNITS DAY;
LET r = r + MOD(l, 86400) UNITS SECOND;
RETURN r;
END PROCEDURE;
Combining two 'n UNITS x' operations in a single line breaks something
at runtime; it compiles OK but doesn't work for me on Solaris 7 with IDS
9.21.UC1.
--
Yours,
Jonathan Leffler (Jonathan.Leffler@Informix.com) #include <disclaimer.h>
Guardian of DBD::Informix v1.00.PC1 -- http://www.perl.com/CPAN
"I don't suffer from insanity; I enjoy every minute of it!"
We use strictly necessary cookies to make this site work. With your
consent we’d also use optional cookies for analytics and marketing. You can accept all,
reject all, or choose. Read our Cookie Policy.