pg.ddx.io  pgsql-odbc@postgresql.org mailing list archive  
help / color / mirror / Atom feed
The way Access/ODBC does updates to records
2+ messages / 2 participants
[nested] [flat]

* The way Access/ODBC does updates to records
@ 2003-03-17 19:16 Davide Romanini <romaz@libero.it>
  0 siblings, 0 replies; 2+ messages in thread

From: Davide Romanini @ 2003-03-17 19:16 UTC (permalink / raw)
  To: pgsql-odbc

Hi,

When I link postgreSQL tables to access, and try to modify a record, I 
found that odbc sends a query to postgresql containing a lot of fields 
in the WHERE clause. For example:

I have a table names with fields id, name, surname, address.
When I modify an existing record changing the name from Davide to 
Daniele, I expect that odbc sends a query like this:
UPDATE names SET name='Daniele' WHERE id=1;
or, in the case it looks for contamporary changes:
UPDATE names SET name='Daniele' WHERE id=1 AND name='Davide';

Instead I see it uses:
UPDATE names SET name='Daniele' WHERE id=1 AND name='Davide' AND 
surname='Romanini' AND address='My address';

It wouldn't be a problem, but with some datatypes (dates, doubles for 
example) and sometimes with triggers that change data before updates, 
it has problems like the "Another user is changing the same data".

I want to know if there's a way to force access (or odbc) to use only 
primary key fields in the WHERE clause for un UPDATE (there aren't 
reasons to use other fields).

Thanks, Romaz
--
Davide Romanini




^ permalink  raw  reply  [nested|flat] 2+ messages in thread

* Re: The way Access/ODBC does updates to records
@ 2003-03-20 14:48 Henshall, Stuart - Design & Print <SHenshall@westcountry-design-print.co.uk>
  0 siblings, 0 replies; 2+ messages in thread

From: Henshall, Stuart - Design & Print @ 2003-03-20 14:48 UTC (permalink / raw)
  To: Davide Romanini <romaz@libero.it>; pgsql-odbc

Try using row versioning.
hth,
- Stuart

> -----Original Message-----
> From: Davide Romanini [mailto:romaz@libero.it]
> Sent: 17 March 2003 19:16
> To: pgsql-odbc@postgresql.org
> Subject: [ODBC] The way Access/ODBC does updates to records
> 
> 
> Hi,
> 
> When I link postgreSQL tables to access, and try to modify a 
> record, I 
> found that odbc sends a query to postgresql containing a lot 
> of fields 
> in the WHERE clause. For example:
> 
> I have a table names with fields id, name, surname, address.
> When I modify an existing record changing the name from Davide to 
> Daniele, I expect that odbc sends a query like this:
> UPDATE names SET name='Daniele' WHERE id=1;
> or, in the case it looks for contamporary changes:
> UPDATE names SET name='Daniele' WHERE id=1 AND name='Davide';
> 
> Instead I see it uses:
> UPDATE names SET name='Daniele' WHERE id=1 AND name='Davide' AND 
> surname='Romanini' AND address='My address';
> 
> It wouldn't be a problem, but with some datatypes (dates, doubles for 
> example) and sometimes with triggers that change data before updates, 
> it has problems like the "Another user is changing the same data".
> 
> I want to know if there's a way to force access (or odbc) to use only 
> primary key fields in the WHERE clause for un UPDATE (there aren't 
> reasons to use other fields).
> 
> Thanks, Romaz
> --
> Davide Romanini
> 
> 
> ---------------------------(end of 
> broadcast)---------------------------
> TIP 5: Have you checked our extensive FAQ?
> 
> http://www.postgresql.org/docs/faqs/FAQ.html
> 


DISCLAIMER:The information in this message is confidential and may be
legally privileged. It is intended solely for the addressee.  Access to this
message by anyone else is unauthorised.  If you are not the intended
recipient, any disclosure, copying, or distribution of the message, or any
action or omission taken by you in reliance on it, is prohibited and may be
unlawful.  Please immediately contact the sender if you have received this
message in error. Thank you.

^ permalink  raw  reply  [nested|flat] 2+ messages in thread


end of thread, other threads:[~2003-03-20 14:48 UTC | newest]

Thread overview: 2+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2003-03-17 19:16 The way Access/ODBC does updates to records Davide Romanini <romaz@libero.it>
2003-03-20 14:48 Re: The way Access/ODBC does updates to records Henshall, Stuart - Design & Print <SHenshall@westcountry-design-print.co.uk>

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox