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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 2, 20262026-06-02T16:31:58+00:00 2026-06-02T16:31:58+00:00

Suppose you have a DB table like this: Table t …. column_a integer column_b

  • 0

Suppose you have a DB table like this:

Table t
....
column_a     integer
column_b     varchar(255)
....

Now, I want to store a string that is composed by a list of names on t.column_b, with the following format (separated by commas):

Word A, Word B, Word C...

The problem is, it might be the case that the string is larger than 255 characters and in my application logic I don’t want to blindly trim to 255, but instead store the maximum number of words possible, eliminating the last word that exceeds the size. Also, I want to develop in such a way that if the column changes size, I don’t want to change my application. Is it possible to write a SQL query that retrieves the declared size of a column? Or perhaps, I should use another column type?

If relevant, I am using Informix.

Thanks in advance.

  • 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-02T16:31:59+00:00Added an answer on June 2, 2026 at 4:31 pm
    1. Informix truncates blindly at the limit unless your database is MODE ANSI.
    2. The DBI defines metadata attributes for columns and DBD::Informix implements them.

      For a statement handle, $sth, you can use:

      $sth->{PRECISION}->[0]
      

      to get the precision (length) of the first column in the output.

    See perldoc DBI under ‘Statement Handle Attributes’.

    If you need to know the type information for some column, write a SELECT statement, prepare it, then analyze the statement handle.

    Because this is defined by DBI, you will get the same behaviour with any driver (DBD::YourDBMS).

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

Sidebar

Related Questions

Suppose you have a table like this: id user score It's a dump of
Suppose I have a table like: create table { id numeric(5,3), code varchar(10) }
Suppose I have a table of users. Something like: ID integer, USER text, POSITION
Suppose I have a table like so: <table> <tr><td class=this-is-a-label>Label Cell</td></tr> <tr><td>Detail 1</td></tr> <tr><td
Suppose I have a simple table, like this: Smith | Select Jones | Select
Suppose, I have a table like this- Code | something ------------------ C01 abc C02
I have a table like this: create table t1 { person_id int, item_name varchar(30),
Suppose I have a Person table that looks like this, where fk_FriendID is related
Suppose I have a specific table selected in TinyMCE, like this: var ed =
Suppose I have a table, Foo, that looks like this: ID | Name |

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.