Announcement

Collapse
No announcement yet.

Unterstützt IB EXTERNAL FILE BLOB Felder

Collapse
X
  • Filter
  • Time
  • Show
Clear All
new posts

  • Unterstützt IB EXTERNAL FILE BLOB Felder

    Ich würde gerne meine IMPORT/EXPORT Funktionen über SQL EXTERNAL FILE realisieren nur scheint Interbase keine BLOB Format dafür zu unterstützen. Stimmt das ??? und gibt es eine Alternative ohne BDE

  • #2
    Hallo,

    in CodeCentral sind die Klassen TIBOutputRawFile und TIBInputRawFile zu finden:

    <i>
    TIBOutputRawFile and TIBInputRawFile can't handle VARCHAR fields correctly.
    Also BLOB fields's data isn't included on the output file, just the BLOB ID.
    This makes this components almost unusable for real data transfer unless you
    don't use VARCHAR fields on your applications and / or don't want transfer
    BLOB data.

    VARCHAR fields are always transfered with 2 bytes less than they have because
    XSQLVAR.sqllen helds the field length without counting the field's actual length
    word witch is at the begining of the field contents (XSQLVAR.sqldata^). Then the
    solution is to add the length word when the field is written and readed to and
    from the file.

    To transfer BLOB data, instead of writting BLOB ID (what is held on
    XSQLVAR.sqldata^) just get the read data from the source field (LoadFromStream)
    then write length (resulting stream's Size property) and write actual BLOB data
    to output file.

    Because I need flat file transfer capabilities on a new project I wrote
    TLSIBOutputRawFile and TLSIBInputRawFile witch exports and imports to and from
    raw file as TIBOutputRawFile and TIBInputRawFile do but with VARCHAR and BLOB
    support.
    </i&gt

    Comment


    • #3
      Hallo Herr Kosch,<br>
      erstmal Danke für die Info aber <br>
      ich beabsichtige den Export/Import mit SQL auf dem IB-Server zu realisieren. BeispielIhr Buch C/S mit Delphi Seite 405)<br>
      <b>CREATE TABLE</b> myExport <b>EXTERNAL FILE</b> "C:\myExport.txt"(<br>
      Satz1 varchar(100),<br>
      Satz2 BLOB SUB_TYPE 1 SEGMENT SIZE 80,<br>
      )<br&gt

      Comment

      Working...
      X