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

  • Home
  • SEARCH
  • 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 8560479
In Process

The Archive Base Latest Questions

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

I have a MySQL table, let’s call it Permissions , with numeric columns UserId

  • 0

I have a MySQL table, let’s call it Permissions, with numeric columns UserId and Privilege. The UserId column is considered to be a decimal value, but Privilege is supposed to be a hexadecimal value. The hexadecimal values are better for privilege codes (because every privilege bit is responsible for the flags like R, W, X and so on), and this is widely used by us for the INSERT statements using the hexadecimal literals, e.g.:

INSERT INTO `Permissions` (`UserId`, `Privilege`) VALUES (12, 0x53);

Let’s assume that 3 in 0x53 is a flag mask standing for encoded privilege actions, so a person who read such an INSERT statement can easily understand that this permission grants R(1) and W(2) permissions. But when the query to the Permissions table is executed, e.g. in native MySQL client, the privilege value is shown as decimal (please assume SELECT * FROM):

+--------+-----------+
| UserID | Privilege |
+--------+-----------+
|     12 |        83 |
+--------+-----------+

Is there a way to recommend MySQL clients to display (not return as strings) some numeric columns in hexadecimal view by default? It probably might be somewhere in table metadata, hmmm, “recommendations” or somewhere in clients configs – honestly, I have no any idea on that. Another reason of why this is useful is that it could be possible to use simple SELECT * FROM query not applying the HEX() function for a certain column every time you invoke the query, where HEX() even changes the result set column type from number to string.

Any ideas? Your help would be really appreciated. Thanks in advance.


P.S. I’m not sure if this question should be asked here. If a better place is at SuperUser or Database Administrators, please migrate. Thanks!

  • 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-11T16:17:07+00:00Added an answer on June 11, 2026 at 4:17 pm

    It seems that a VIEW would be what you want. Just select all of the columns, specifying HEX(Permissions) as Permissions, and tell clients to use the view instead of the table.

    http://dev.mysql.com/doc/refman/5.5/en/create-view.html

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

Sidebar

Related Questions

Okay, so let's say I have a mysql database table with two columns, one
I have a MySQL table. Let's call it Widgets. The Widget table has 3
Let's say I have 3 MySQL table. A song db called songs that has
Let's say I have a MySQL table that is something like this: software table:
Let's say I have a mysql table, called foo with a foreign key option_id
Let's assume that I have mytable in mySQL CREATE TABLE `mytable` ( `gender` enum('MALE','FEMALE','UNISEX')
I have mysql table that has a column that stores xml as a string.
Let's say I have a MySQL table and a table has a row with
i have the following mysql table.... ----------------------- id customer_name date ----------------------- now let me
Let's say I have records in a MySQL table that have a unix timestamp

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.