Page 1 of 1

ZQuery.Post without field xyz

Posted: 08.07.2022, 13:46
by nlanger
If I fetch an SQL command from a view and it contains a field that cannot be changed (from another table), it works fine for ZQuery.Edit and ZQuery.Post. An error occurs (from MS-SQLserver) with ZQuery.Insert and ZQuery.Post because the field must not be modified with.

Can I remove the field from the set of fields to be changed?

In Zeos 6.6.6 it worked with: TZDataset(QU_).SetFieldDesc(F,True);

Norbert

Re: ZQuery.Post without field xyz

Posted: 11.07.2022, 08:35
by marsupilami
nlanger wrote: 08.07.2022, 13:46 If I fetch an SQL command from a view and it contains a field that cannot be changed (from another table), it works fine for ZQuery.Edit and ZQuery.Post. An error occurs (from MS-SQLserver) with ZQuery.Insert and ZQuery.Post because the field must not be modified with.

Can I remove the field from the set of fields to be changed?

In Zeos 6.6.6 it worked with: TZDataset(QU_).SetFieldDesc(F,True);

Norbert
Hello Norbert,

this sounds like a bug if Zeos ignores the field for updates but doesn't ignore it for inserts. Is the field correctly marked as ReadOnly? I added some preliminary release notes. Maybe the chapter "Zeos now respects TField.ProviderFlags" will help you?

Best regards,

Jan

Re: ZQuery.Post without field xyz

Posted: 11.07.2022, 16:20
by marsupilami
Another option might be to use TZUpdateSQL. There you can specify an operation to carry out on the database for each operation.

Re: ZQuery.Post without field xyz

Posted: 15.07.2022, 10:31
by nlanger
Hello jan

Yes, that fits, if I deleted "pfInUpdate" from the ProviderFlags, the field is not taken into account in the update. :D

Thanks
Norbert

Re: ZQuery.Post without field xyz

Posted: 25.07.2022, 12:14
by Fr0sT
Alternative is to use threaded splash screen
https://stackoverflow.com/questions/388 ... 2#45465592