DBGrid Append/Post on PostgreSQL table with identity column
Posted: Wed 01 Jan 2020 16:23
Hello,
I am using Delphi 10.3.3, UniDAC 8.1.2, PostgreSQL 12.1 on Windows 10 64Bit, targeting win32 executable.
I have a table created using following SQL:
I use this table on a regular TDBGrid using TUniQuery. TUniQuery has following SQL:
I have following codes in my form to open TUniQuery:
This way, I can enter new rows only by writing data in abc column. However, I cannot see autoinc column values after posting new rows.
Is it possible to see autoinc column value right after posting? Without having to use close/open or refresh?
Thanks & regards,
Ertan
I am using Delphi 10.3.3, UniDAC 8.1.2, PostgreSQL 12.1 on Windows 10 64Bit, targeting win32 executable.
I have a table created using following SQL:
Code: Select all
create table if not exists test1(
autoinc bigint generated by default as identity not null primary key,
abc varchar(20)
);
Code: Select all
select * from test1
Code: Select all
UniQuery1.Close();
UniQuery1.Open();
UniQuery1.FieldByName('autoinc').Required := False;
UniQuery1.FieldByName('autoinc').AutoGenerateValue := arAutoInc;
Is it possible to see autoinc column value right after posting? Without having to use close/open or refresh?
Thanks & regards,
Ertan