Sign in Join

Live chat for Free Pascal, Lazarus, Delphi and every Pascal programmer.

Mailing lists / fpc-pascal / 2017-11

FreePascal and MySQL ?

3 messages · 3 people ·

Reply by email Subscribe to this list Your subscription

Read-only archive. Use j and k to move between messages.

Terry A. Haimann

Hello,

This is probably a dumb question. But I have data in a tstringlist that I want to upload into a MediumText MySQL column. It looks to me as if you do something like:

	Stream := TMemoryStream.Create;
	MySL.SaveToStream(Stream);
	Blobfield(BcfQuery.FieldByName('JobMemo')).
		LoadFromStream(Stream);

But what I don't understand is how I indicate what row to add the MediumText field to. Is there some way to combine this with an insert or update statement. I have done a lot in the past with MySQL and FreePascal, but I have mostly or entirely worked with standard columnar data, i.e. (Strings, floats and integers).

Thanks in advance,

Terry H.

Reply by email

Snorkl e
to Terry A. Haimann
You don't need to use a stream just do
Dataset.fieldbyname('somecolumn').asstring:=mystringlist.text
"Terry A. Haimann" wrote 24 lines
Hello, This is probably a dumb question. But I have data in a tstringlist that I want to upload into a MediumText MySQL column. It looks to me as if you do something like: Stream := TMemoryStream.Create; MySL.SaveToStream(Stream); Blobfield(BcfQuery.FieldByName('JobMemo')). LoadFromStream(Stream); But what I don't understand is how I indicate what row to add the MediumText field to. Is there some way to combine this with an insert or update statement. I have done a lot in the past with MySQL and FreePascal, but I have mostly or entirely worked with standard columnar data, i.e. (Strings, floats and integers). Thanks in advance, Terry H. _______________________________________________ fpc-pascal maillist - http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal

Reply by email

Michael Van Canneyt
to Terry A. Haimann: This is probably a dumb question. But I have data in a tstringlist that I want to upload…
Terry A. Haimann wrote 13 lines
Hello, This is probably a dumb question. But I have data in a tstringlist that I want to upload into a MediumText MySQL column. It looks to me as if you do something like: Stream := TMemoryStream.Create; MySL.SaveToStream(Stream); Blobfield(BcfQuery.FieldByName('JobMemo')). LoadFromStream(Stream); But what I don't understand is how I indicate what row to add the MediumText field to.

Edits are always on the current row in the dataset.

Michael.

Reply by email