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 9144113
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 17, 20262026-06-17T10:11:23+00:00 2026-06-17T10:11:23+00:00

I have some numeric data that is given to me in INTEGER form. I

  • 0

I have some numeric data that is given to me in INTEGER form. I insert it along with other data into SQLite but when I write it out The INTEGER Numbers need to be 8 digit Hex Numbers with leading zeros.

Ex.

Input

400 
800 
25 
76

Output

00000190 
00000320 
00000019 
0000004C

Originally I was converting them as I read them in and storing them as TEXT like this.

stringstream temp;
temp << right << setw(8) << setfill('0') << hex << uppercase << VALUE;

But life is never easy and now I have to create a second output in INTEGER form not HEX. Is there a way to convert INTEGER numbers to HEX or HEX numbers to INTEGERS in SQLite?

I’d like to avoid using C++ to change data after it is in SQLite because I’ve written a few convent export functions that take a queries result and print them to a file. If I need to touch the data during the queries return I couldn’t use them.

I’ve looked at the HEX() function in SQLite but that didn’t have desired results. Could I make a function or would that be very inefficient? I’m doing this over a really big data set so anything expensive should be avoided.

Note:
I’m using SQLites C/C++ interface with Visual Studios 2010.

  • 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-06-17T10:11:24+00:00Added an answer on June 17, 2026 at 10:11 am

    Well not my favorite answer I’ve decided to add a column in the table that is the INTEGER value.

    If someone finds a better way to do this I’m all ears.

    EDIT:

    After Implementing this answer and looking at it’s effect on the program this appears to be a really good way to get the data without adding much to the run time load. This answer does add to the size of the Database a little but it doesn’t require any extra processing to get the values from SQLite because this is just grabbing a different column in the query.

    Also because I had these values to start with, this answer had a HUGE cost savings by adding them to the table verses processing later to get values I through away earlier in the program.

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

Sidebar

Related Questions

I have some varchar data that has numeric values in it, and I'm trying
I have some imported csv data that I have turned into an xts object.
I have some arbitrary pixel data that I want to save as a PNG.
We have some input data that sometimes appears with &nbsp characters on the end.
I have some strings in my database. Some of them have numeric values (but
I have an data table I wish to perform some numeric analysis on for
So I have some lidar data that I want to calculate some metrics for
I have a dataframe with some numeric columns. Some row has a 0 value
I have a range, containing numeric values & blank cells. Some of the numeric
I need to have a formula produce a null in some cases, numeric in

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.