SitePoint Sponsor

User Tag List

Results 1 to 5 of 5
  1. #1
    SitePoint Addict
    Join Date
    Mar 2002
    Location
    Miami, Florida - Caracas, Venezuela
    Posts
    379
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    column type question

    What column type should I use if I don't know what type will be stored?

    I have a table of objects that may be simple text, an image or who knows what... the idea is to keep them together and avoid having tables for each type of object. Also, I'd rather keep all in one column and not have one column for blob and other for char or text.

    What are the consecuences of storing data in a column that is of a conflicting or different type?

    Thank you
    Luis

  2. #2
    SQL Consultant gold trophysilver trophybronze trophy
    r937's Avatar
    Join Date
    Jul 2002
    Location
    Toronto, Canada
    Posts
    39,341
    Mentioned
    63 Post(s)
    Tagged
    3 Thread(s)
    the only thing that fits your requirement is a BLOB because it is the only datatype that can hold a binary object
    rudy.ca | @rudydotca
    Buy my SitePoint book: Simply SQL
    "giving out my real stuffs"

  3. #3
    SitePoint Addict
    Join Date
    Mar 2002
    Location
    Miami, Florida - Caracas, Venezuela
    Posts
    379
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    But then if I have a text object won't it be affected by being stored in a non-text type field?
    Luis

  4. #4
    SQL Consultant gold trophysilver trophybronze trophy
    r937's Avatar
    Join Date
    Jul 2002
    Location
    Toronto, Canada
    Posts
    39,341
    Mentioned
    63 Post(s)
    Tagged
    3 Thread(s)
    you can store anything in a blob

    the more important question is, however, why you would want to?

    i mean, if the table has only a blob column, wouldn't you be better off just storing your objects on the file system? you'll get faster response, i'm sure
    rudy.ca | @rudydotca
    Buy my SitePoint book: Simply SQL
    "giving out my real stuffs"

  5. #5
    SitePoint Addict
    Join Date
    Mar 2002
    Location
    Miami, Florida - Caracas, Venezuela
    Posts
    379
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I suppose you are right...

    The thing is, even though most of the objects I'll be storing are going to be text, there will also be things like images. I wanted to provide a web interface to edit all text objects. I suppose blob type objects could be referenced from the column...

    hmmm.... I need to analyze the apps structure again... I'll get back to you. Thank you,
    Luis


Bookmarks

Posting Permissions

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