FreePascal and MySQL ?

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

FreePascal and MySQL ?

Terry A. Haimann-2
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  -  [hidden email]
http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal
Reply | Threaded
Open this post in threaded view
|

Re: FreePascal and MySQL ?

Snorkl e
You don't need to use a stream just do 
Dataset.fieldbyname('somecolumn').asstring:=mystringlist.text


On Nov 20, 2017 10:02 AM, "Terry A. Haimann" <[hidden email]> wrote:
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  -  [hidden email]
http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal

_______________________________________________
fpc-pascal maillist  -  [hidden email]
http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal
Reply | Threaded
Open this post in threaded view
|

Re: FreePascal and MySQL ?

Michael Van Canneyt
In reply to this post by Terry A. Haimann-2


On Mon, 20 Nov 2017, Terry A. Haimann wrote:

> 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.
_______________________________________________
fpc-pascal maillist  -  [hidden email]
http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal