[Lazarus] Help reading SQLite field with more than 255 chars

mulcamd mulcamd at hotmail.com
Mon Nov 18 22:00:34 CET 2013


I'm reading the SQLite database of Adobe Lightroom (SQLite).

 

I want to process the AdditionalMetadata table, see below, the XMP field,
which may be 3000 chars long.

When retrieving the contents of this field I only get 255.

 

Question:

What should I do to get the full content of this field.

BTW, I cannot change the database, because it comes from Adobe.

 

This is the code I use:

============ Start code

  SQLite3Connection1.DatabaseName:='Test_v5.lrcat';

  SQLite3Connection1.Transaction:=SQLTransaction1;

 

  SQLTransaction1.Database:=SQLite3Connection1;

 

  SQLQuery1.Database:=SQLite3Connection1;

  SQLQuery1.Transaction:=SQLTransaction1;

  SQLQuery1.SQL.Text:='Select id_local, xmp  from Adobe_AdditionalMetadata';

  SQLQuery1.Open;

  SQLQuery1.Next;

 

  i := SQLQuery1.FieldByName('id_local').AsInteger;

  ShowMessage(IntToStr(i));

  myText := SQLQuery1.FieldByName('xmp'). as TBlobField;

//            Here I only get 255 chars

  ShowMessage(myText);

================ End code

 

CREATE TABLE Adobe_AdditionalMetadata (

    id_local INTEGER PRIMARY KEY,

    id_global UNIQUE NOT NULL,

    additionalInfoSet INTEGER NOT NULL DEFAULT 0,

    embeddedXmp INTEGER NOT NULL DEFAULT 0,

    externalXmpIsDirty INTEGER NOT NULL DEFAULT 0,

    image INTEGER,

    incrementalWhiteBalance INTEGER NOT NULL DEFAULT 0,

    internalXmpDigest,

    isRawFile INTEGER NOT NULL DEFAULT 0,

    lastSynchronizedHash,

    lastSynchronizedTimestamp NOT NULL DEFAULT -63113817600,

    metadataPresetID,

    metadataVersion,

   monochrome INTEGER NOT NULL DEFAULT 0,

    xmp NOT NULL DEFAULT ''

)

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.lazarus-ide.org/pipermail/lazarus/attachments/20131118/858d9d07/attachment-0002.html>


More information about the Lazarus mailing list