@WJSwanepoel
I hope you're not a spammer. If not welcome to the forum.
1. Remove the cast from the SQL, use it like this: "select DATA from CONTENT;"
2. Double click your query, a dialog should popup with the available fields, select "DATA" then go to ObjectInspector-->Events-->OnGetText
3: I assume the blob is text type not binary
procedure TForm1.SQLQuery1DATAGetText(Sender: TField; var aText: string;
DisplayText: Boolean);
var
Ms: TStream;
begin
DisplayText := False;
if not TField(Sender).IsNull then
begin
Ms := SQLQuery1.CreateBlobStream(TField(Sender), bmRead);
try
if Ms.Size > 0 then
begin
Ms.Position := 0;
SetLength(aText, Ms.Size);
Ms.Read(Pointer(aText)^, Ms.Size);
DisplayText := True;
end;
finally
Ms.Free;
end;
end;
end;
Please note: the grid cannot display multiple lines, at least not properly. If your blob contains multiple line you should should show in a separate memo, or even better a TDBMemo.