Results 1 to 7 of 7
  1. #1
    Join Date
    Dec 2002
    Posts
    17

    Question Unanswered: Import one whole file to only one cell of a table

    Hi everybody,

    I am currently working on my diploma. One task of the diploma is to create a database to store files in. These files should be stored as they are in one and only cell per row and table each. No links to the filesystem are allowed!

    Can anybody tell me what type of column that should be and what I have to do to import hundreds of files into these cells?

    Please answer quickly - thx!
    ----------------------------------------
    visit us @ www.gamesquare.org

  2. #2
    Join Date
    Apr 2002
    Posts
    188

    Re: Import one whole file to only one cell of a table

    Originally posted by virtualwinner
    Hi everybody,

    I am currently working on my diploma. One task of the diploma is to create a database to store files in. These files should be stored as they are in one and only cell per row and table each. No links to the filesystem are allowed!

    Can anybody tell me what type of column that should be and what I have to do to import hundreds of files into these cells?

    Please answer quickly - thx!
    Hello ,

    you can use CLOB for big files text
    you can use BLOB for binary such as images

    I will go for those data types

    my two cents

    marcos oliva

  3. #3
    Join Date
    Dec 2002
    Posts
    17
    k, and what will I have to enter as size? I do not know what size all the files have! what is this sizething?

    ...and my main problem is to get the files into the database! can it be done by a sort of script (large number of files!)? - how can I manage this?
    ----------------------------------------
    visit us @ www.gamesquare.org

  4. #4
    Join Date
    Apr 2002
    Posts
    188
    Originally posted by virtualwinner
    k, and what will I have to enter as size? I do not know what size all the files have! what is this sizething?

    ...and my main problem is to get the files into the database! can it be done by a sort of script (large number of files!)? - how can I manage this?
    that was fastt..

    you can not specify the size by means of a script, BLOB adn CLOBS have limits I think on the range of 2gig max, so ask yourself if
    you will ever get a file greater than 2 gigs.
    you can create a table and set the size for the BLOB or CLOB as
    2g if you want or play around with it.

    marcos oliva

  5. #5
    Join Date
    Dec 2002
    Posts
    17
    and how can I get the file data into this CLOB?
    ----------------------------------------
    visit us @ www.gamesquare.org

  6. #6
    Join Date
    Dec 2002
    Posts
    17

    Question

    does anybody know how i can get the content of a whole file into one CLOB (not as a link)?

    ...maybe there is a way to do this by command line?

    My System:
    Win2000 Pro, DB2 7.2 fixpack 4
    ----------------------------------------
    visit us @ www.gamesquare.org

  7. #7
    Join Date
    Aug 2001
    Location
    UK
    Posts
    4,650
    You can use IMPORT command ... Check the Command Reference Manual for details ...

    As an example ...


    table: t100(i int,j clob(1m))
    Command: db2 import from r.del.txt of del lobs from C:\temp\ modified by lobsinfile insert into t100

    r.del.txt format: (to insert the file xml.txt in C:\temp\

    1,"xml.txt"


    Hope this helps ...

    Cheers

    Sathyaram

Posting Permissions

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