Ask a Question related to Informix, Design and Development.

  1. #1

    Default VARCHAR or not ?



    Solaris 8
    IDS 7.31 FD3


    We have to create a table, that will contain a code, a short description and then a long description (up to 2000 characters).
    This is basically a lookup table, and will be used for browsing, verifying and selecting codes.

    Varchar has a limit of 255 characters. Does this mean I have to define a char(2000) column for the long description ?

    Any suggestions ?


    Regards
    Dirk



    sending to informix-list
    Dirk Moolman Guest

  2. Similar Questions and Discussions

    1. varchar vs text
      Are there any differences between text and varchar? I found the following in the docs, which leads me to believe that there are no differences at...
    2. converting varchar to double
      Hi, I try to cast/convert a varchar into a double but it doesn't work, i get an error that it isn't possible to convert. What can I do? The...
    3. text and varchar
      Hello, sorry for the trivial question. Is there any difference between varchar and text types in practice? I couldn't find. Mage ...
    4. Question about varchar and text
      What is the difference between varchar and text? I have heard that you can use text instead of varchar and this could speed up your tables. ...
    5. varchar truncated at 255 characters
      i have a SP that builds a t-sql script. I use a varchar variable to build the script. I have declared the variable as varchar(8000). When I run...
  3. #2

    Default Re: VARCHAR or not ?

    ....
    > Varchar has a limit of 255 characters. Does this mean I have to define a
    char(2000) column for the long description ?
    Basically - YES. You could also use TEXT field, but I wouldn't recommend it.
    > Any suggestions ?
    Split your description into multiple lines which can then be of VARCHAR
    type.

    Gorazd


    Gorazd Hribar Rajterič Guest

  4. #3

    Default Re: VARCHAR or not ?

    Dirk Moolman wrote:
    > Solaris 8
    > IDS 7.31 FD3
    >
    >
    > We have to create a table, that will contain a code, a short description
    > and then a long description (up to 2000 characters). This is basically a
    > lookup table, and will be used for browsing, verifying and selecting
    > codes.
    >
    > Varchar has a limit of 255 characters. Does this mean I have to define a
    > char(2000) column for the long description ?
    >
    > Any suggestions ?
    Upgrade to 9.30 or 9.40 -- use the LVARCHAR data type, which can now be (I
    think) up to 32K. Definitely 2K.
    Obnoxio The Clown Guest

  5. #4

    Default Re: VARCHAR or not ?

    On Tue, 09 Sep 2003 06:07:50 -0400, Dirk Moolman wrote:

    Split the description in to a subsidiary table containing just the key, a
    sequence number, and a small CHAR or VARCHAR (say 80 or 100 bytes per record).
    If the natural key of the parent table is too long add a SERIAL column in the
    parent table and use that as the key to the child table along with the sequence
    number. Then you can have as many or as few detail lines as needed with
    minimal waste.

    Art S. Kagel
    > Solaris 8
    > IDS 7.31 FD3
    >
    >
    > We have to create a table, that will contain a code, a short description and
    > then a long description (up to 2000 characters). This is basically a lookup
    > table, and will be used for browsing, verifying and selecting codes.
    >
    > Varchar has a limit of 255 characters. Does this mean I have to define a
    > char(2000) column for the long description ?
    >
    > Any suggestions ?
    >
    >
    > Regards
    > Dirk
    >
    >
    >
    > sending to informix-list
    Art S. Kagel Guest

Posting Permissions

  • You may not post new threads
  • You may post replies
  • You may not post attachments
  • You may not edit your posts

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139