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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 15, 20262026-06-15T17:33:01+00:00 2026-06-15T17:33:01+00:00

I have an Informix database that I really would have liked an ‘enum’ field

  • 0

I have an Informix database that I really would have liked an ‘enum’ field for. Being that Informix (At least in the version I am constrained to) has no built-in enum type I used some Google-Foo to find out that I could constrain a VARCHAR field to only allow certain values like so:

ALTER TABLE table ADD CONSTRAINT CHECK (type IN ('type1',  'type2', 'type3'));

This seems to work well. Now I need to connect to the database from a Perl script that checks user input against those valid values. I can of course check them in code and make sure my code knows what the values are that the database requires, but I wondered if there is any way I could have my script query the constraint on the database therefore if I need to Add/Remove a valid input at a later time I could just alter the constraint and the processing code would adapt.

Any suggestions would be greatly appreciated.

  • 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-15T17:33:01+00:00Added an answer on June 15, 2026 at 5:33 pm

    If you encapsulate you database access in a DBIx::Class schema, you gain this kind of validation “as a bonus”.
    A simple way of generating the schema from a pre-existing database is by
    dbicdump.

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

Sidebar

Related Questions

I have Informix database with timestamp field defined as YEAR TO SECOND. When I
I have some code that uses an Informix 11.5 database that I want to
I have a Java web application that has Informix as its back end database.
I would like to transfer the whole Database i have in Informix to Oracle.
I have been tasked with converting some scripts referencing an Informix database to be
We have an Informix 4GL forms interface to our database, accessed using a terminal
So we are migrating from Informix to Sql Server. And I have noticed that
I have to connect my app to a customer's Informix 7.2 legacy database. From
I have an Informix database containing measured temperature values for quite a few different
In Informix I can run SQL statement that use other database: INSERT INTO other_db:mytable

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.