[DUG] Using Queries

David Moorhouse David.Moorhouse at pegasus.org.nz
Mon Jun 13 18:43:37 NZST 2022


Depending on the underlying data store I would caution against a direct writable connection to the database.  Due to permission and security concerns.

E.g. do you really want users to be able to randomly alter any data, what about deletes, audit tables etc.

Cheers

D



David Moorhouse (BCom) | Development Manager
Regional HealthOne Programme
P: 03 353 0871
E: david.moorhouse at pegasus.org.nz
401 Madras St, Christchurch 8013
PO Box 741, Christchurch 8140



-----Original Message-----
From: delphi-bounces at listserver.123.net.nz <delphi-bounces at listserver.123.net.nz> On Behalf Of Adrian Williams
Sent: Monday, 13 June 2022 10:05 am
To: NZ Borland Developers Group - Delphi List <delphi at listserver.123.net.nz>
Subject: [DUG] Using Queries

Hi all

I wonder if someone could clarify something regarding Queries.

I understand that if you run a query on a table it returns a  subset or snapshot of data from the table based on the SQL statement supplied. (In my Paradox days, a query created an 'ANSWER' table that could be navigated as a table, but was separate from the original data).

What I have discovered (more by accident), is that if you edit records in the query data and call  the query's POST method it will post the changes back to original table. Also by using the APPEND and INSERT methods on the query, you can create new records in the base table. What I have been able to ascertain is that the database engine seamlessly creates the SQL code to run UPDATE and INSERT statements to amend the original table in the background.

My question is: Is this a 'proper' and acceptable way of updating a table by modifying the Query data? Or is this fraught with danger and bad practice?

Appreciate any comments on this.

Regards
Adrian Williams
_______________________________________________
NZ Borland Developers Group - Delphi mailing list
Post: delphi at listserver.123.net.nz
Admin: https://aus01.safelinks.protection.outlook.com/?url=http%3A%2F%2Fdelphi.org.nz%2Fmailman%2Flistinfo%2Fdelphi&amp;data=05%7C01%7Cdavid_m%40pegasushealth.mail.onmicrosoft.com%7C7b930b43ff84410bd7d408da4cc0a17b%7C3ee1ab78075342db8dab9bf1b07b2b1a%7C0%7C0%7C637906688665756119%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&amp;sdata=s%2B%2Fv97d93Iigw9AXAfBoFBa%2BIeOCMb1M9O1mK1didpI%3D&amp;reserved=0
Unsubscribe: send an email to delphi-request at listserver.123.net.nz with Subject: unsubscribe
***********************************
This email or attachment(s) may contain confidential or legally privileged information intended for the sole use of the addressee(s). Any use, redistribution, disclosure, or reproduction of this message, except as intended, is prohibited. If you received this email in error, please notify the sender and erase all copies of the message, including any attachments. Any views or opinions expressed in this email (unless otherwise stated) may not represent those of Pegasus Health Ltd.
***********************************



More information about the Delphi mailing list