Hello
How to work with GUID field in Firebird database?
I created next table:
create table test (id Integer, GUID char(16) octets);
How assign values to GUID fields from my applicaton?
How to work with GUID field in Firebird database?
-
- Posts: 11
- Joined: Tue 30 Nov 2010 04:17
Re: How to work with GUID field in Firebird database?
To set the GUID field value, you can use the following code:
Code: Select all
procedure TForm.Button1Click(Sender: TObject);
var
GUID: TGUID;
Arr: TBytes;
begin
ClientDataSet.Edit;
Arr := GUID.Create('{F0C5A5FC-8E64-48FB-80B0-A62FFED81E48}').ToByteArray;
ClientDataSet.FieldByName('guid').AsBytes := Arr;
ClientDataSet.Post;
ClientDataSet.ApplyUpdates(0);
end;