Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6541777
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T11:08:47+00:00 2026-05-25T11:08:47+00:00

Question: How can I store a 128 bit integer (IPv6) with nHibernate ? Especially

  • 0

Question:

How can I store a 128 bit integer (IPv6) with nHibernate ?

Especially on Firebird, where the BigInteger MAX size is 2^64 .

I want to do calculations like :

SELECT * FROM T_Country_IP_Range 
WHERE 
(block_from <= @in_IP) 
AND (block_to >= @in_ip)

So storing it as text/varchar/char is not an option.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-25T11:08:48+00:00Added an answer on May 25, 2026 at 11:08 am

    It seems indeed that there is no firebird support for INT128.

    What you can do is represent the 128bits as two 64 bit fields, the upper 64bit in one field (IP_upper) and the lower 64bits in the other (IP_Lower).

    All comparison operation will have to compare both fields. If the upper field is smaller/larger or if it’s equal and then check the lower field:

    SELECT * FROM T_Country_IP_Range 
    WHERE 
    (
        block_from_upper < @in_IP_upper 
        OR 
        (block_from_upper = @in_IP_upper AND block_from_lower <= @in_IP_lower)
    ) 
    AND 
    (
        block_to_upper > @in_IP_upper 
        OR 
        (block_to_upper = @in_IP_upper AND block_to_lower >= @in_IP_lower)
    )
    

    Kinda awkward, no doubt

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

My question is how can I get the HTML of one page and store
Guys i had posted a question earlier pypdf python tool .dont mark this as
I'll try to be as clear as I can. I have already implemented my
I am using .NET 2.0 with PlatformTarget x64 and x86. I am giving Math.Exp
In Python 2.5 I stored data using this code: def GLWriter(file_name, string): import cPickle
I am trying to do some UI validation on a database name. I was
It would seem that there is a much simpler way to state the problem.
QuestionsTable id* (int) | question_text (string) | question_type (int) AlternativesTable id* (int) | question_id
How does one insert a new child to a particular node in a TreeView
Within a Java EE environment (happens to be WAS 6.1 but could be any

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.