 |
BorlandTalk.com Borland discussion newsgroups
|
| View previous topic :: View next topic |
| Author |
Message |
Tommy Guest
|
Posted: Tue Jun 07, 2005 7:36 am Post subject: Store Array to MySQL table |
|
|
Hi,
I have a "ABC : [0..511] array of byte", and now I want to store this array to MySQL table.
But I don't know how to do, can anyone help me!!!
THX.
Tommy.
|
|
| Back to top |
|
 |
Dmitry Arefiev [gs-soft.r Guest
|
Posted: Tue Jun 07, 2005 9:06 am Post subject: Re: Store Array to MySQL table |
|
|
Hi Tommy !
| Quote: | I have a "ABC : [0..511] array of byte", and now I want to store this array to MySQL
table.
|
At MySQL table you should use column of type BLOB.
On Delphi side you should write something like that:
var
s: String;
begin
SQLQuery1.SQL.Text := 'insert into tab (abcfield) values (:abcfield)';
SetString(s, PChar(@ABC[0]), 512);
SQLQuery1.Params[0].AsBlob := s;
SQLQuery1.ExecSQL;
end;
Regards,
Dmitry
--
Dmitry Arefiev - www.da-soft.com
AnyDAC - Oracle, MySQL, MSSQL, MSAccess, IBM DB2, Sybase
ASA, DbExpress, ODBC freeware data access framework
gs-soft AG - www.gs-soft.com
SAPx - Delphi to SAP R/3 direct access
Saphir - SAP R/3 metadata at your fingertips
MetaBase - ERWIN model in Delphi applications
|
|
| Back to top |
|
 |
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
|