473,621 Members | 2,743 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Are select queries with inner joins updatable?

Access 2000
Trying even the most basic queries - select queries joining (inner
join) two tables - and the results are not updatable, and I can't tell
why they aren't. All permissions are on, recordset is dynaset, unique
values is no, etc.. etc..

Here's the SQL if it helps..:

SELECT tbl.ID
FROM tbl INNER JOIN Master ON tbl.IDNumber = Master.IDNumber ;

Should these results not be updatable? Ideas? Thanks!
Martin Lacoste
Nov 13 '05 #1
14 2552
On 2 Jul 2004 14:41:30 -0700, ma*******@roger s.com (Martin Lacoste)
wrote:
Access 2000
Trying even the most basic queries - select queries joining (inner
join) two tables - and the results are not updatable, and I can't tell
why they aren't. All permissions are on, recordset is dynaset, unique
values is no, etc.. etc..

Here's the SQL if it helps..:

SELECT tbl.ID
FROM tbl INNER JOIN Master ON tbl.IDNumber = Master.IDNumber ;

Should these results not be updatable? Ideas? Thanks!
Martin Lacoste


Try putting the join key of both tables in the query.

SELECT tbl.IDNumber, Master.IDNumber
FROM tbl INNER JOIN Master ON tbl.IDNumber = Master.IDNumber ;
- Jim
Nov 13 '05 #2
Two things: 1) Make sure the tables have primary keys, and 2) make sure you
have the latest JET update.
Nov 13 '05 #3
On 03 Jul 2004 00:50:36 GMT, dc****@aol.comSPNOAM (DCM Fan) wrote:
Two things: 1) Make sure the tables have primary keys, and 2) make sure you
have the latest JET update.


Well, duh!
What made you come up with those observations/suggestions?

Nov 13 '05 #4
<<What made you come up with those observations/suggestions?>>

10 years of answering questions on this board, obviously posted by novices.

Here are a few more, if those suggestions offended you. Are you joining on the
keyed fields? Are these tables LINKED from a different backend DB than JET? Are
tehre any extraneous properties applied, like filters or sorting?
Nov 13 '05 #5
On 03 Jul 2004 05:09:17 GMT, dc****@aol.comSPNOAM (DCM Fan) wrote:
<<What made you come up with those observations/suggestions?>>

10 years of answering questions on this board, obviously posted by novices.
Ooh. Now wer'e all puffed up.
Here are a few more, if those suggestions offended you. Are you joining on the
keyed fields? Are these tables LINKED from a different backend DB than JET? Are
tehre any extraneous properties applied, like filters or sorting?

I wasn't offended, it's just that your suggestions - to my posting -
were unnecessary. Just noise and therefore potentially confusing.

The OP wanted to know why an INNER JOIN wasn't updateable. I provided
what I considered a succinct - and helpful - response which, IME, is a
better approach to problem solving. Just throwing stuff at it isn't
particularly productive.

For example you stated:
Two things: 1) Make sure the tables have primary keys, and 2) make sure you
have the latest JET update.


For the problem presented 1) is not relevant - primary keys, per se,
have no bearing on whether the recordset can be updated or appended.

As for 2); well, yes, you should *always* make sure you have the
latest updates - Jet or otherwise. You could tag that onto every post
or put it in your sig.

Regards,
- Jim

Nov 13 '05 #6
<< primary keys, per se,
have no bearing on whether the recordset can be updated or appended.>>

Technically, you're correct, but one DOES NEED a unique index in order for any
JET query to be updatable through a join.

I'm trying to get the OP to think in terms of Primary Keys, however, which have
the added constraint of being non-nullable, and seemed more-appropriate in the
context of what was posted.

So, to be perfectly accurate (and possibly more confusing), I should have said
this instead: "Make sure each table has a Primary Key--or at least a UNIQUE
INDEX."

Back to you!

I dare you to make some tables without PK (nor UI) and then update one of them
through a join...just from a fundamantal database engine standpoint it SHOULD
NOT BE POSSIBLE. Otherwise, how would Access really know which records to
update? If Access CAN do this, then it must be using its own internal mechanism
for determining 'absolute rows' in the set....I'm not sure if I'm cool with
that.

(Actually, Access MUST use some kind of internal uniqueness mechanism when it's
allowing users to update a table directly, even though the table might not have
a PK nor UI! But I doubt Access can do that through a join...it needs PK or
UI.)
Nov 13 '05 #7
On 03 Jul 2004 18:00:14 GMT, dc****@aol.comSPNOAM (DCM Fan) wrote:
<< primary keys, per se,
have no bearing on whether the recordset can be updated or appended.>>

Technically, you're correct, but one DOES NEED a unique index in order for any
JET query to be updatable through a join.

I'm trying to get the OP to think in terms of Primary Keys, however, which have
the added constraint of being non-nullable, and seemed more-appropriate in the
context of what was posted.

So, to be perfectly accurate (and possibly more confusing), I should have said
this instead: "Make sure each table has a Primary Key--or at least a UNIQUE
INDEX."

Back to you!

I'm not interested in a pissing contest and I accept your modified
statements. The thing is; the OP didn't say anything that would
suggest that he was not using PKs. (When creating a table in Access
you must go out of your way to create a table without a PK.) The SQL
he posted was missing - as I noted - the FK from the SELECT statement
which would cause the problem.

If you had responded to him instead of my post then I wouldn't have
posted to you at all.

- Jim
Nov 13 '05 #8
dc****@aol.comSPNOAM (DCM Fan) wrote in message news:<20******* *************** *****@mb-m10.aol.com>...
<<What made you come up with those observations/suggestions?>>

10 years of answering questions on this board, obviously posted by novices.

Here are a few more, if those suggestions offended you. Are you joining on the
keyed fields? Are these tables LINKED from a different backend DB than JET? Are
tehre any extraneous properties applied, like filters or sorting?


Thanks for all the responses thus far. And yet, sigh, I'm still no
further than before. There are primary keys present, I have tried
joining on the keyed fields, NOT joining on the keyed fields, etc..
No added filters or sorting present - I purposely made a super simple
query to see if I could indeed eliminate as many variables as
possible, and yet, still, it states it is not updatable.

I am perplexed as to why this is so difficult an issue - between
scouring the help files, searching the internet, including Microsoft's
database, and inquiring on newsgroups, I have yet still not found the
solution to what I thought was a simple problem. That is by no means
intended as an insult to those of you who have provided suggestions -
many thanks! I'm just surprised that either: a) access does not make
some rather simple things actually simple; or.. b) that it is so
difficult for someone with decent computer skills (yes, still learning
access) is having to spend so much time (add to that the time all of
you have taken!) figuring this out.

Well, I'll continue to hunt high and low, and I still invite other
suggestions, no matter how banal - it could be something stupid, but
evidently I'm either not *that* stupid, or much *too* stupid to figure
it out :-(.

Ok, rant over... - thanks again folks!!
Martin Lacoste
Nov 13 '05 #9
On 3 Jul 2004 11:56:49 -0700, ma*******@roger s.com (Martin Lacoste)
wrote:
dc****@aol.com SPNOAM (DCM Fan) wrote in message news:<20******* *************** *****@mb-m10.aol.com>...
<<What made you come up with those observations/suggestions?>>

10 years of answering questions on this board, obviously posted by novices.

Here are a few more, if those suggestions offended you. Are you joining on the
keyed fields? Are these tables LINKED from a different backend DB than JET? Are
tehre any extraneous properties applied, like filters or sorting?


Thanks for all the responses thus far. And yet, sigh, I'm still no
further than before. There are primary keys present, I have tried
joining on the keyed fields, NOT joining on the keyed fields, etc..
No added filters or sorting present - I purposely made a super simple
query to see if I could indeed eliminate as many variables as
possible, and yet, still, it states it is not updatable.

I am perplexed as to why this is so difficult an issue - between
scouring the help files, searching the internet, including Microsoft's
database, and inquiring on newsgroups, I have yet still not found the
solution to what I thought was a simple problem. That is by no means
intended as an insult to those of you who have provided suggestions -
many thanks! I'm just surprised that either: a) access does not make
some rather simple things actually simple; or.. b) that it is so
difficult for someone with decent computer skills (yes, still learning
access) is having to spend so much time (add to that the time all of
you have taken!) figuring this out.

Well, I'll continue to hunt high and low, and I still invite other
suggestions, no matter how banal - it could be something stupid, but
evidently I'm either not *that* stupid, or much *too* stupid to figure
it out :-(.

Ok, rant over... - thanks again folks!!
Martin Lacoste


Just curious. Did you SELECT both join keys as I suggested? They must
*both* be in the SELECT statement. They were not in your original
posting you had SELECTED only 1. You could copy and post the SQL of
the query (what you originally posted was obviously not copied)

- Jim
Nov 13 '05 #10

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
1323
by: Bernd Kohler | last post by:
Hello, some little questions relating LAMP (PHP 4.3.4, MySQL 3.x, Apache): I'm trying to build a community website which needs many db-querys for lots of concurrent users. Therefore I'm always using: $ergebnis = mysql_query ($sql) or die (mysql_error()); while ($row = mysql_fetch_array($ergebnis)) { $myvar = $row;
4
1371
by: Denis St-Michel | last post by:
Hello All, Hope some Guru will be able to help me with this. Let's take this example table A ------------------------------------------------------------------------------- id | TicketNo | evaluation | Username ------------------------------------------------------------------------------- 1 1 9 Jamie 2 1 8.5 ...
1
2263
by: Gerald Maher | last post by:
Hi I need to select 2 tables . The field 'p_description' is not always aviable but i still need to print it to the screen SELECT * FROM task,p_description WHERE ComponentIDLink = 34 OR task.TaskID = p_description.pTaskLink GROUP BY TaskID ORDER BY TaskName
23
82006
by: Brian | last post by:
Hello All - I am wondering if anyone has any thoughts on which is better from a performance perspective: a nested Select statement or an Inner Join. For example, I could do either of the following: SELECT supplier_name FROM supplier
2
1875
by: Johnny M | last post by:
I have been using Access since office 4.3. I have just upgraded to Office 2003 and am having issues with creating updatable queries. If I link one table to a selection query based on the same table, the resulting query is not updatable. OR If I link 2 tables together that don't have a primary key the result is not updatable. I know I was able to do this in previous versions since I usually don't use a primary key. Thanks
6
1418
by: Carlo B | last post by:
Hi I need to use a listbox to display authors from the authors table in the standard BIBLIO.MDB. I haven't even got to this point yet and the code below is bombing out on the line 'dataAdapter.Fill(dt)'. If I only run 'Select * from Titles' then it works fine. Even if I try 'Select Titles.title from .....' it bombs. Please help Thanks Carlo
2
1279
by: Pasquale | last post by:
I am using the query below for a multi event registration confirmation page. Any one of these events can have individuals and/or teams, which also then can have different categories of individuals or teams. I came upon a glitch in that if a captain has more than one team registration for different events the team names for all his/her events show up on the confirmation page for each event. So... Captain1: Team1 - Event1
6
9303
by: dmonroe | last post by:
hi group -- Im having a nested inner join problem with an Access SQl statement/Query design. Im running the query from ASP and not usng the access interface at all. Here's the tables: tblEmployees empId -- EmpName -- EmpRole -- EmpManager -------....------------.... ---------....--------------- 1........ dan yella..........1..........2
22
12457
by: MP | last post by:
vb6,ado,mdb,win2k i pass the sql string to the .Execute method on the open connection to Table_Name(const) db table fwiw (the connection opened via class wrapper:) msConnString = "Data Source=" & msDbFilename moConn.Properties("Persist Security Info") = False moConn.ConnectionString = msConnString moConn.CursorLocation = adUseClient moConn.Mode = adModeReadWrite' or using default...same result
0
8213
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8653
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
8597
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
8306
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
7127
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
5554
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4150
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
2587
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
1
1763
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.