How to save Long data type in a DB?
DBAsupport.com Forums - Powered by vBulletin
Results 1 to 6 of 6

Thread: How to save Long data type in a DB?

  1. #1
    Join Date
    Mar 2001
    Location
    Ireland/Dublin
    Posts
    684
    Hi !
    Is anybody can give me advice how to save long data type (1-2Mb) in a DB using PL/SQL?

    Yes, I know about LOB, but I need to know how to save LONG or LONG ROW data type in a DB using PL/SQL. As we are using application of another firm which does not support LOB data type, it support only Long and Long Row. Of course I can use Stream and to save data using C++, but I need to save it using PL/SQL.
    Thank you.

  2. #2
    Join Date
    Jul 2001
    Location
    Lahore-Pakistan
    Posts
    2

    Wink Long Data Type

    Mr. KGB,

    I'm facing the same problem regarding saving data in Long data type using Oracle Developer 2000.

    I have to save a text of some 200-300 pages with each record, Long data type support (I think 2GB) but Developer's control is not accepting data more than 4-5 pages.

    If you find any remedy, please share with me.

    Thank you,

    Khalid
    khmahmood@yahoo.com

  3. #3
    Join Date
    Mar 2001
    Location
    Ireland/Dublin
    Posts
    684

    Re: Long Data Type

    O'k,
    For now I see 2 possible ways: load data using C++ or Java Stream frough external function in first way. But problem is: we are using Linux and I never used Streams for Unix. :-)
    If I manage it I'll let you know.
    Best wishes!

  4. #4
    Join Date
    Jul 2001
    Location
    Lahore-Pakistan
    Posts
    2

    Long Field

    Dear KGB,
    I have received a possible solution for saving data in Long field of Oracle through developer but it is not feasible for me as I cannot do search in the following solution.

    I have not only to save some 200-300 pages in a field and then find out all records matching a string.

    I'm reproducing the gentlman's reply in the following.

    Khalid Alvi

    ++++++++++++++++
    Received from Mr. Gilbert Rattink
    ++++++++++++++++

    Although we are not a helpdesk for Oracle matters, I hopefully have a
    solution to your problem. As you can read below, there is a restriction in
    Developer 6.0 with respect to the Long (or LOB) datatype. (I copied this
    text from the on-lone Help in Form Builder). A solution would be NOT to
    store the text in a column in the database, but to store it in a file on
    your filesystem and store the name of the fila in the database. Using
    OLE/OCX you then could call an external editor tha you launch from your
    developer-application.
    I hope this is to some help for you.

    About Oracle8 large objects (LOBs)

    Using Oracle Developer, you can access the Oracle8 large object datatypes:
    binary large objects (BLOBs), character large objects (CLOBs and NCLOBs),
    and binary files (BFILEs).
    On an Oracle8 server, these datatypes can store objects of up to 4 gigabytes
    in size. They are similar in purpose to the familiar Oracle7 LONG and LONG
    RAW datatypes, but offer a number of additional advantages.

    Comparison of LOBs with LONGs

    LOBs LONGs
    Up to 4 gigabytes Up to 2 gigabytes
    Multiple LOB columns allowed in a single table Only one LONG column allowed
    per table
    Replication supported No replication
    Random data access supported Only sequential access
    supported
    Better table space management (only LOB locator is stored) Less
    efficient (data is stored directly in table)
    Allowed in user-defined object types Not allowed
    Easily passed to procedures and external calls Not easily passed


    LOBs in detail:

    BLOBs are used to store large objects in binary format. CLOBs and NCLOBs
    are used to store character data - in single- and multi-byte formats,
    respectively. These three types are also known as internal LOBs, because
    their data is stored within the server. The data participates in
    transactions and integrity control, including commits and rollbacks.
    BFILEs, in contrast, are stored outside of the server. The server stores
    only the operating system address of the file. As a consequence, BFILEs can
    not participate in database transactions.


    Compatibility
    Because of the various advantages offered by LOBs (see the table above), you
    should used LOBs instead of LONGs in any new application.
    However, for backward compatibility, LONGs are still fully supported.

    Restrictions in Developer R6.0

    BFILEs are read-only.

    LOBs cannot exceed 65534 bytes.

  5. #5
    Join Date
    Mar 2001
    Location
    Ireland/Dublin
    Posts
    684
    Thank you !!!
    That is good idea, but I am doing replication system for LONG data type and I have save data in the database as our application writes information to the database and I'll not be able to change it as it was made by another firm.
    I am kepping looking the way ...
    Now I am thinking about Corba server.

    Best wishes!

  6. #6
    Join Date
    Mar 2001
    Location
    Ireland/Dublin
    Posts
    684
    I'v got an Idea!
    You may save your text by parts for example: by 5 pages
    in each row.
    Best wishes.

Posting Permissions

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



Click Here to Expand Forum to Full Width