Re: Re: finding inplace alters
Posted in 2011
Yes... Wikipedia talks about it... I guess that if someone ports Informix to
PDP-11 we'll see a -746 exception :)
Thanks. Andreas already tested this on Solaris and apparently it works.
Regards.
On Wed, Jan 12, 2011 at 4:25 PM, Art Kagel <art.kagel@gmail.com> wrote:
> There used to be a third alternative to big-endian and little-endian. Call
> it big-little. The result would look like: '00010010'. But, the only
> processors I can think of that used that format were DEC processors, so I
> guess your OK with what you have.
>
> Art
>
>
> Art S. Kagel
> Advanced DataTools (www.advancedatatools.com)
> IIUG Board of Directors (art@iiug.org)
> Blog: http://informix-myview.blogspot.com/
>
> Disclaimer: Please keep in mind that my own opinions are my own opinions
> and do not reflect on my employer, Advanced DataTools, the IIUG, nor any
> other organization with which I am associated either explicitly, implicitly,
> or by inference. Neither do those opinions reflect those of other
> individuals affiliated with any entity with which I am affiliated nor those
> of the entities themselves.
>
>
>
> On Wed, Jan 12, 2011 at 11:14 AM, Fernando Nunes <domusonline@gmail.com>wrote:
>
>> Thanks Andreas. I did something similar:
>>
>> SELECT
>> s.hexdata[1,8]
>> INTO
>> v_hexdata
>> FROM
>> sysmaster:syssltdat s
>> WHERE
>> s.partnum = '0x100001' AND
>> s.pagenum = 1 AND
>> s.slotnum = 1 AND
>> s.slotoff = 0;
>>
>> IF v_hexdata = '01001000'
>> THEN
>> LET v_endian = 'LITTLE';
>> ELSE
>> IF v_hexdata = '00100001'
>> THEN
>> LET v_endian = 'BIG';
>> ELSE
>> RAISE EXCEPTION -746, 0, 'Invalid Endianess calculation...
>> Check procedure code!!!';
>> END IF
>> END IF
>>
>> Tested on little endian and apparently it works.
>> If somebody can test it on a Big Endian machine (Solaris, AIX, HP-UX
>> Itanium....) I'd appreciate...
>> Just run the query and see if it returns '00100001'
>>
>> Kind regards.
>>
>> P.S.: Pending IPA finder through SQL looks good (although the code is a
>> bit odd, it is working).
>> I'll post it as soon as I test it on a "real" system to check the running
>> time... For now, just on my VM which is just a "toy"...
>>
>>
>>
>> On Wed, Jan 12, 2011 at 10:10 AM, Andreas Legner <
>> andreas.legner@de.ibm.com> wrote:
>>
>>>
>>> Hi Fernando,
>>>
>>> you mean how to determine engine's endianess using an SQL query?
>>>
>>> There might be more elegant ways, but what about
>>>
>>> select first 1 hexdata from sysmaster:sysrawdsk;>>>
>>> This would return first 16 raw bytes from root chunk, so something
>>> starting on "00000000 0001" from big endian and "00000000 0100" from little
>>> endian servers.
>>> Of course this is restricted to user informix.
>>>
>>> In case this page zero uses an old page header (pre-9.40 page), you'd get
>>> "00000001" or "01000000" respectively. You could tell the two cases by
>>> checking if first 8 nibbles all are zeroes.
>>>
>>> More easily, you could:
>>>
>>> select first 1 hexdata[1,4] from sysshmem;>>>
>>> This should return first shmem segments magic number 0xe0b7, as either
>>> "e0b7" or "b7e0".
>>>
>>> Cheers,
>>> Andreas
>>>
>>>
>>>
>>>
>>> From:
>>> Fernando Nunes <domusonline@gmail.com>
>>> To:
>>> Andreas Legner/Germany/IBM@IBMDE
>>> Cc: informix-list@iiug.org Date: 12.01.2011 03:06 Subject: Re: Re:
>>> finding inplace alters
>>> ------------------------------
>>>
>>>
>>>
>>> Andreas,
>>>
>>> Thanks for the reply, and don't bother... You were right... A checkpoint
>>> is needed.
>>> So, at this moment I have something that apparently works... But needs
>>> some refinement and further testing...
>>> Also... I need a way to find out if the platform is little endian or big
>>> endian.... any ideas?
>>>
>>> Regards!
>>>
>>
>>
>>
>> --
>> Fernando Nunes
>> Portugal
>>
>> http://informix-technology.blogspot.com
>> My email works... but I don't check it frequently...
>>
>> _______________________________________________
>> Informix-list mailing list
>> Informix-list@iiug.org
>> http://www.iiug.org/mailman/listinfo/informix-list
>>
>>
>
--
Fernando Nunes
Portugal
http://informix-technology.blogspot.com
My email works... but I don't check it frequently...