[fpc-pascal] TField.DataType and ftBlob type

Graeme Geldenhuys graemeg at opensoft.homeip.net
Mon Jul 27 13:29:56 CEST 2009


Hi,

Many database systems have sub-types for Blob fields. One such example 
is Firebird/Interbase.

     qfkBinary:     Result := 'Blob sub_type 0';
     qfkLongString: Result := 'Blob sub_type 1';
     ....


Currently I have code that converts the TField.DataType to our 
framework's local data types....

     ftString,
     ftWideString:
         Result := qfkString;

     ftBlob,
     ftGraphic,
     ftVarBytes:
         Result := qfkBinary;

Is there any way to find out the Sub-Type of a ftBlob in SqlDB? I would 
like to distinguish between binary data and long text data stored in a 
Blob field.


For example, in Delphi's IBX or the cross-compiler FBLib components, I 
could do the following...

begin
   case (AData.sqltype and (not 1)) of
     SQL_BLOB:     begin
                     case AData.sqlsubtype of
                     isc_blob_untyped:   result := qfkBinary;
                     isc_blob_text:      result := qfkLongString;
                     else
                       raise EtiOPFInternalException.Create('Invalid 
FireBird sql subtype');
                     end;
                   end;


So is there a way I can find more information regarding TField.DataType 
when DataType = ftBlob?


Regards,
   - Graeme -

-- 
fpGUI Toolkit - a cross-platform GUI toolkit using Free Pascal
http://opensoft.homeip.net/fpgui/




More information about the fpc-pascal mailing list