Save TStringList on Pg and Get it after
Posted: 29.07.2011, 18:05
I create a table with a bytea column that I use to save a TStringList.
Ok, it's inserting as I'd like. When I execute an SQL on PGAdmin I can see the right information.
But, when I use the zeos connection and zeos query to select this field, I get a very strange value.
To save the file in column I do some thing like:
When I select this column by PgAdmin this works, and I can see the text correctly.
But when I select it using Zeos, with a code like:
I get a very strange value.
Some one can help me with this ?
Tks
Ok, it's inserting as I'd like. When I execute an SQL on PGAdmin I can see the right information.
But, when I use the zeos connection and zeos query to select this field, I get a very strange value.
To save the file in column I do some thing like:
Code: Select all
LStringList := TStringList.Create;
LStringList.Text := 'Test zeos connection';
LStringList.SaveToStream(LStream);
LStream.Postion := 0;
LParam := FDBConnection.SQLQuery.ParamByName('BColumn');
LParam.ParamType := ptInput;
LParam.DataType := ftBlob;
LParam.SetBlobData(LStream.Memory, LStream.Size)
But when I select it using Zeos, with a code like:
Code: Select all
ZQuery1.FieldByName('BColumn').AsString;
Some one can help me with this ?
Tks