c# - How to store a 128 bit integer with nHibernate? -
question:?
How can I store a 128-bit integer with nHibernate (IPv6)
especially Firebird, where BigInteger is at MAX ^ 2 ^ 64 < P> I want to calculate as:
select * T_Country_IP_Range where (block_from & lt;; = @in_IP) and (block_to & gt ;. = @in_ip) then this storage as text / varchar / four is not an option
It really does not seem to have any Firebird support for INT128.
What you can do is represent 128bits as two 64-bit fields, upper 64 bits in one area ( IP_upper ) and others in less 64bits ( IP_Lower ). All comparison operations must be compared to the farm. If the upper area is small / large or if it is equal and then check the lower area: SELECT * to T_Country_IP_Range WHERE (block_from_upper & lt; @_____ above) (block_from_upper = @in_IP_upper and block_from_lower & Lt; = @in_IP_lower) and (block_to_upper> gt; @in_IP_upper or (block_to_upper = @in_IP_upper and block_to_lower & gt; = @in_IP_lower)) Kinda Strange, no doubt < / P>
Comments
Post a Comment