By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
435,640 Members | 2,355 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 435,640 IT Pros & Developers. It's quick & easy.

Join expression not supported - using Access 2000 and CF

P: n/a
<cfquery name="getAll" datasource="#request.dsn#">
SELECT U.userID, U.fname, U.lname, U.phone, U.lastLoggedIn,
U.choiceId, U.experience, T.label AS teamLabel, R.label AS
roleLabel
FROM User U LEFT JOIN UserTeamAssoc UTA
ON UTA.userID = U.userID,
Role R, UserRoleAssoc URA, Team T
WHERE U.userID = URA.userID
AND URA.roleID = R.roleID
AND U.userId > 1
ORDER BY #orderBy# #orderByTxt#
</cfquery>

This query produces the following error:

Join expression not supported.

Has anyone else run into this problem, if so, what can I do about it? I do
not have the ability to install Access on my machine so any solution could
not involve working with Access itself (I do have the .mdb file that I use
via ColdFusion App Server)

Phil
Nov 12 '05 #1
Share this Question
Share on Google+
12 Replies


P: n/a
In article <dP1ab.183646$xf.175404@lakeread04>,
so*****@erols.com says...
<cfquery name="getAll" datasource="#request.dsn#">
SELECT U.userID, U.fname, U.lname, U.phone, U.lastLoggedIn,
U.choiceId, U.experience, T.label AS teamLabel, R.label AS
roleLabel
FROM User U LEFT JOIN UserTeamAssoc UTA
ON UTA.userID = U.userID,
Role R, UserRoleAssoc URA, Team T
WHERE U.userID = URA.userID
AND URA.roleID = R.roleID
AND U.userId > 1
ORDER BY #orderBy# #orderByTxt#
</cfquery>

This query produces the following error:

Join expression not supported.

Has anyone else run into this problem, if so, what can I do about it? I do
not have the ability to install Access on my machine so any solution could
not involve working with Access itself (I do have the .mdb file that I use
via ColdFusion App Server)


It looks pretty good to me - although I always list my non
outer joined tables in the from clause first - ie:

FROM Role R, UserRoleAssoc URA, Team T, User U
LEFT JOIN UserTeamAssoc UTA
ON UTA.userID = U.userID

I dunno if that matters though...

--
Cam
Nov 12 '05 #2

P: n/a
That didn't work it produced a "join expression not supported' error

<cfquery name="getAll" datasource="#request.dsn#">
SELECT U.userID, U.fname, U.lname, U.phone, U.lastLoggedIn,
U.choiceId, U.experience, R.label AS roleLabel
FROM Role R, UserRoleAssoc URA, Team T, User U
LEFT JOIN UserTeamAssoc UTA ON UTA.userID = U.userID
ORDER BY #orderBy# #orderByTxt#
</cfquery>

Phil
"Cam Penner"
<Ca*********************************************** ***@hotmail.com> wrote in
message news:MP************************@News.CIS.DFN.DE...
In article <dP1ab.183646$xf.175404@lakeread04>,
so*****@erols.com says...
<cfquery name="getAll" datasource="#request.dsn#">
SELECT U.userID, U.fname, U.lname, U.phone, U.lastLoggedIn,
U.choiceId, U.experience, T.label AS teamLabel, R.label AS
roleLabel
FROM User U LEFT JOIN UserTeamAssoc UTA
ON UTA.userID = U.userID,
Role R, UserRoleAssoc URA, Team T
WHERE U.userID = URA.userID
AND URA.roleID = R.roleID
AND U.userId > 1
ORDER BY #orderBy# #orderByTxt#
</cfquery>

This query produces the following error:

Join expression not supported.

Has anyone else run into this problem, if so, what can I do about it? I do not have the ability to install Access on my machine so any solution could not involve working with Access itself (I do have the .mdb file that I use via ColdFusion App Server)


It looks pretty good to me - although I always list my non
outer joined tables in the from clause first - ie:

FROM Role R, UserRoleAssoc URA, Team T, User U
LEFT JOIN UserTeamAssoc UTA
ON UTA.userID = U.userID

I dunno if that matters though...

--
Cam

Nov 12 '05 #3

P: n/a
In article <IT2ab.183659$xf.63322@lakeread04>,
so*****@erols.com says...
That didn't work it produced a "join expression not supported' error

<cfquery name="getAll" datasource="#request.dsn#">
SELECT U.userID, U.fname, U.lname, U.phone, U.lastLoggedIn,
U.choiceId, U.experience, R.label AS roleLabel
FROM Role R, UserRoleAssoc URA, Team T, User U
LEFT JOIN UserTeamAssoc UTA ON UTA.userID = U.userID
ORDER BY #orderBy# #orderByTxt#
</cfquery>


The guy I work with just muttered something to me about
sometimes needing to surround join clauses in access with
curly braces. You might want to try looking into that.
(he's not within shouting distance right now, but if you
have more trouble I'll get him to post something)

--
Cam
Nov 12 '05 #4

P: n/a
SOrry that failed as well! :( He needs to shout louder!

Phil

*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!
Nov 12 '05 #5

P: n/a
This might help, this is how I'd write it in Oracle:

<cfquery name="getAll" datasource="#request.dsn#">
SELECT U.userID, U.fname, U.lname, U.phone, U.lastLoggedIn,
U.choiceId, U.experience, R.label AS roleLabel
FROM Role R, UserRoleAssoc URA, Team T, User U, UserTeamAssoc UTA
WHERE U.userId = URA.userID
AND URA.roleId = R.roleId
AND U.userId = UTA.userID (+)
AND T.teamId = UTA.teamID (+)
AND U.userID > 1
ORDER BY #orderBy# #orderByTxt#
</cfquery>

Phil
"Cam Penner"
<Ca*********************************************** ***@hotmail.com> wrote in
message news:MP************************@News.CIS.DFN.DE...
In article <IT2ab.183659$xf.63322@lakeread04>,
so*****@erols.com says...
That didn't work it produced a "join expression not supported' error

<cfquery name="getAll" datasource="#request.dsn#">
SELECT U.userID, U.fname, U.lname, U.phone, U.lastLoggedIn,
U.choiceId, U.experience, R.label AS roleLabel
FROM Role R, UserRoleAssoc URA, Team T, User U
LEFT JOIN UserTeamAssoc UTA ON UTA.userID = U.userID
ORDER BY #orderBy# #orderByTxt#
</cfquery>


The guy I work with just muttered something to me about
sometimes needing to surround join clauses in access with
curly braces. You might want to try looking into that.
(he's not within shouting distance right now, but if you
have more trouble I'll get him to post something)

--
Cam

Nov 12 '05 #6

P: n/a
In article <MP************************@News.CIS.DFN.DE>,
Cam.Penner.news1ATpleasedontspamgoldmedalsystems.c om@hotmai
l.com says...
In article <IT2ab.183659$xf.63322@lakeread04>,
so*****@erols.com says...
That didn't work it produced a "join expression not supported' error

<cfquery name="getAll" datasource="#request.dsn#">
SELECT U.userID, U.fname, U.lname, U.phone, U.lastLoggedIn,
U.choiceId, U.experience, R.label AS roleLabel
FROM Role R, UserRoleAssoc URA, Team T, User U
LEFT JOIN UserTeamAssoc UTA ON UTA.userID = U.userID
ORDER BY #orderBy# #orderByTxt#
</cfquery>


The guy I work with just muttered something to me about
sometimes needing to surround join clauses in access with
curly braces. You might want to try looking into that.
(he's not within shouting distance right now, but if you
have more trouble I'll get him to post something)


Try something along the lines of:
<cfquery name="getAll" datasource="#request.dsn#">
SELECT U.userID, U.fname, U.lname, U.phone,
U.lastLoggedIn,
U.choiceId, U.experience, R.label AS
roleLabel
FROM Role R, UserRoleAssoc URA, Team T, User U
{oj LEFT OUTER JOIN UserTeamAssoc UTA ON UTA.userID
= U.userID}
ORDER BY #orderBy# #orderByTxt#
</cfquery>

I'll stop guessing now if someone has the proper answer...
;)

--
Cam
Nov 12 '05 #7

P: n/a
"Phil Powell" <so*****@erols.com> wrote in message news:<dP1ab.183646$xf.175404@lakeread04>...
<cfquery name="getAll" datasource="#request.dsn#">
SELECT U.userID, U.fname, U.lname, U.phone, U.lastLoggedIn,
U.choiceId, U.experience, T.label AS teamLabel, R.label AS
roleLabel
FROM User U LEFT JOIN UserTeamAssoc UTA
ON UTA.userID = U.userID,
Role R, UserRoleAssoc URA, Team T
WHERE U.userID = URA.userID
AND URA.roleID = R.roleID
AND U.userId > 1
ORDER BY #orderBy# #orderByTxt#
</cfquery>

This query produces the following error:

Join expression not supported.

Has anyone else run into this problem, if so, what can I do about it? I do
not have the ability to install Access on my machine so any solution could
not involve working with Access itself (I do have the .mdb file that I use
via ColdFusion App Server)

Phil


Phil,

I see you don't have a join-clause for the Team-table (T).
Is the cartesian product the intention ?
If used an outer join clause, Jet probably doesn't know how to join
the Team table to this .. (the left or right side ?) Access would have
complained 'ambiguous outer join'.
I think either use an inner join in stead of left outer join +
cartesian product with Team or add a join expression for Team.
In general Access prefers explicit join-statements in stead of
implicit ones. For updatability of a query the explicit
join-statements are often one of the conditions.

Marc
Nov 12 '05 #8

P: n/a
"Phil Powell" <so*****@erols.com> wrote in message news:<dP1ab.183646$xf.175404@lakeread04>...
Phil,

Sorry, I forgot to mention another 3rd option, namely to split off the
left-outer join of the 2 tables and to put it in a seperate stored
query and to use that query as a table togeter with the other tables
in an inner-join or cartesian product with the Team table.

Marc
Nov 12 '05 #9

P: n/a
"Phil Powell" <so*****@erols.com> wrote in
news:dP1ab.183646$xf.175404@lakeread04:
<cfquery name="getAll" datasource="#request.dsn#">
SELECT U.userID, U.fname, U.lname, U.phone,
U.lastLoggedIn,
U.choiceId, U.experience, T.label AS teamLabel,
R.label AS
roleLabel
FROM User U LEFT JOIN UserTeamAssoc UTA
ON UTA.userID = U.userID,
Role R, UserRoleAssoc URA, Team T
WHERE U.userID = URA.userID
AND URA.roleID = R.roleID
AND U.userId > 1
ORDER BY #orderBy# #orderByTxt#
</cfquery> This query produces the following error:

Join expression not supported.

Has anyone else run into this problem, if so, what can I do
about it? I do not have the ability to install Access on my
machine so any solution could not involve working with Access
itself (I do have the .mdb file that I use via ColdFusion App
Server)

Phil
First you have no relation set from UTA to T. I've added what I
think you want
Second Access wants inner joins so marked, otherwise it produces
huge recordsets and then filters them through the where clause..

try:
From ((((User U INNER JOIN UserRoleAssoc URA
on U.userID = URA.userID)
INNER JOIN role R
on URA.roleID = R.roleID)
(LEFT JOIN UserTeamAssoc UTA
ON UTA.userID = U.userID
INNER JOIN team t
on T.teamID = UTA.teamID))

You may remove the now unnecessary where clauses.

If you get an error message try converting the last inner join to a
left join. Acess is sometimes picky about mixing inner and outer
joins.

Bob Q


Nov 12 '05 #10

P: n/a
<cfquery name="getAll" datasource="#request.dsn#">
SELECT
U.userID, U.fname, U.lname, U.phone, U.lastLoggedIn,
U.choiceId, U.experience, R.label AS roleLabel, T.label AS teamLabel
FROM
(((User U INNER JOIN UserRoleAssoc URA ON U.userId = URA.userID)
INNER JOIN Role R ON URA.roleId = r.roleID)
LEFT JOIN UserTeamAssoc UTA ON U.userID = UTA.userID)
LEFT JOIN Team T ON T.teamID = UTA.teamID
WHERE U.userID > 1
ORDER BY #orderBy# #orderByTxt#
</cfquery>

This is how I formed it and got a "too few parameters expected 1" error. Is
there anything you can do with this?

Phil
"Marc" <M.***********@uva.nl> wrote in message
news:ae*************************@posting.google.co m...
"Phil Powell" <so*****@erols.com> wrote in message news:<dP1ab.183646$xf.175404@lakeread04>... Phil,

Sorry, I forgot to mention another 3rd option, namely to split off the
left-outer join of the 2 tables and to put it in a seperate stored
query and to use that query as a table togeter with the other tables
in an inner-join or cartesian product with the Team table.

Marc

Nov 12 '05 #11

P: n/a
Sorry, Bob, your query produced the following error:

Error Occurred While Processing Request
Error Executing Database Query.
[MERANT][SequeLink JDBC Driver][ODBC Socket][Microsoft][ODBC
Microsoft Access Driver] Syntax error in JOIN operation.

The Error Occurred in
C:\CFusionMX\wwwroot\sowhat\quill\user.cfc: line 147
Called from C:\CFusionMX\wwwroot\sowhat\quill\user.cfm: line 114
Called from C:\CFusionMX\wwwroot\sowhat\quill\index.cfm: line 3
Called from C:\CFusionMX\wwwroot\sowhat\quill\user.cfc: line 147
Called from C:\CFusionMX\wwwroot\sowhat\quill\user.cfm: line 114
Called from C:\CFusionMX\wwwroot\sowhat\quill\index.cfm: line 3

145 : )
146 : ORDER BY #orderBy# #orderByTxt#
147 : </cfquery>
148 :
149 : <cfreturn getAll />
--------------------------------------------------------------------

SQL SELECT U.userID, U.fname, U.lname, U.phone,
U.lastLoggedIn, U.choiceId, U.experience, R.label AS roleLabel, T.label AS
teamLabel FROM ((((User U INNER JOIN UserRoleAssoc URA on U.userID =
URA.userID) INNER JOIN role R on URA.roleID = R.roleID) (LEFT JOIN
UserTeamAssoc UTA ON UTA.userID = U.userID INNER JOIN team t on T.teamID =
UTA.teamID ) ) ORDER BY U.lname, U.fname ASC
DATASOURCE quill
VENDORERRORCODE -3510
SQLSTATE 42000

Please Try The Following:

a.. Check the CFML Reference Manual to verify that you are using the
correct syntax.

b.. Search the Knowledge Base to find a solution to your problem.
Browser Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.0)
Remote Address 127.0.0.1
Referer
Date/Time 17-Sep-03 06:46 PM
Stack Trace (click to expand)
at
cfuser2ecfc1139593935$funcGETALL.runFunction(C:\CF usionMX\wwwroot\sowhat\qui
ll\user.cfc:147) at
cfuser2ecfm1139593977.runPage(C:\CFusionMX\wwwroot \sowhat\quill\user.cfm:114
) at
cfindex2ecfm98572195.runPage(C:\CFusionMX\wwwroot\ sowhat\quill\index.cfm:3)
at
cfuser2ecfc1139593935$funcGETALL.runFunction(C:\CF usionMX\wwwroot\sowhat\qui
ll\user.cfc:147) at
cfuser2ecfm1139593977.runPage(C:\CFusionMX\wwwroot \sowhat\quill\user.cfm:114
) at
cfindex2ecfm98572195.runPage(C:\CFusionMX\wwwroot\ sowhat\quill\index.cfm:3)
java.sql.SQLException: [MERANT][SequeLink JDBC Driver][ODBC
Socket][Microsoft][ODBC Microsoft Access Driver] Syntax error in JOIN
operation.
at com.merant.sequelink.ssp.Diagnostic.toSQLException (Unknown Source)
at com.merant.sequelink.ssp.Chain.cnvDiagnostics(Unkn own Source)
at com.merant.sequelink.ssp.Chain.decodeDiagnostic(Un known Source)
at com.merant.sequelink.ssp.Chain.decodeBody(Unknown Source)
at com.merant.sequelink.ssp.Chain.decode(Unknown Source)
at com.merant.sequelink.ssp.Chain.send(Unknown Source)
at com.merant.sequelink.ctxt.stmt.StatementContext.se nd(Unknown Source)
at com.merant.sequelink.ctxt.stmt.StmtCtxtState._getD escribeInfo(Unknown
Source)
at com.merant.sequelink.ctxt.stmt.CreatedStmtCtxt.get DescribeInfo(Unknown
Source)
at com.merant.sequelink.ctxt.stmt.StatementContext.ge tDescribeInfo(Unknown
Source)
at com.merant.sequelink.ctxt.stmt.StmtCtxtState._exec Direct(Unknown Source)
at com.merant.sequelink.ctxt.stmt.CreatedStmtCtxt.exe cDirect(Unknown
Source)
at com.merant.sequelink.ctxt.stmt.StatementContext.ex ecDirect(Unknown
Source)
at com.merant.sequelink.jdbc.SequeLinkStatement._exec ute(Unknown Source)
at com.merant.sequelink.jdbc.SequeLinkStatement.execu te(Unknown Source)
at jrun.sql.JRunStatement.execute(JRunStatement.java: 304)
at coldfusion.sql.Executive.executeQuery(Unknown Source)
at coldfusion.sql.Executive.executeQuery(Unknown Source)
at coldfusion.sql.SqlImpl.execute(Unknown Source)
at coldfusion.tagext.sql.QueryTag.doEndTag(Unknown Source)
at
cfuser2ecfc1139593935$funcGETALL.runFunction(C:\CF usionMX\wwwroot\sowhat\qui
ll\user.cfc:147)
at coldfusion.runtime.UDFMethod.invoke(Unknown Source)
at coldfusion.runtime.UDFMethod$ReturnTypeFilter.invo ke(Unknown Source)
at coldfusion.runtime.UDFMethod$ArgumentCollectionFil ter.invoke(Unknown
Source)
at coldfusion.filter.FunctionAccessFilter.invoke(Unkn own Source)
at coldfusion.runtime.UDFMethod.runFilterChain(Unknow n Source)
at coldfusion.runtime.UDFMethod.invoke(Unknown Source)
at coldfusion.runtime.TemplateProxy.invoke(Unknown Source)
at coldfusion.runtime.CfJspPage._invoke(Unknown Source)
at
cfuser2ecfm1139593977.runPage(C:\CFusionMX\wwwroot \sowhat\quill\user.cfm:114
)
at coldfusion.runtime.CfJspPage.invoke(Unknown Source)
at coldfusion.tagext.lang.IncludeTag.doStartTag(Unkno wn Source)
at coldfusion.runtime.CfJspPage._emptyTag(Unknown Source)
at
cfindex2ecfm98572195.runPage(C:\CFusionMX\wwwroot\ sowhat\quill\index.cfm:3)
at coldfusion.runtime.CfJspPage.invoke(Unknown Source)
at coldfusion.tagext.lang.IncludeTag.doStartTag(Unkno wn Source)
at coldfusion.filter.CfincludeFilter.invoke(Unknown Source)
at coldfusion.filter.ApplicationFilter.invoke(Unknown Source)
at coldfusion.filter.PathFilter.invoke(Unknown Source)
at coldfusion.filter.LicenseFilter.invoke(Unknown Source)
at coldfusion.filter.ExceptionFilter.invoke(Unknown Source)
at coldfusion.filter.ClientScopePersistenceFilter.inv oke(Unknown Source)
at coldfusion.filter.BrowserFilter.invoke(Unknown Source)
at coldfusion.filter.GlobalsFilter.invoke(Unknown Source)
at coldfusion.filter.DatasourceFilter.invoke(Unknown Source)
at coldfusion.CfmServlet.service(Unknown Source)
at jrun.servlet.ServletInvoker.invoke(ServletInvoker. java:106)
at jrun.servlet.JRunInvokerChain.invokeNext(JRunInvok erChain.java:42)
at
jrun.servlet.JRunRequestDispatcher.invoke(JRunRequ estDispatcher.java:241)
at
jrun.servlet.ServletEngineService.dispatch(Servlet EngineService.java:527)
at jrun.servlet.http.WebService.invokeRunnable(WebSer vice.java:172)
at
jrunx.scheduler.ThreadPool$DownstreamMetrics.invok eRunnable(ThreadPool.java:
348)
at
jrunx.scheduler.ThreadPool$ThreadThrottle.invokeRu nnable(ThreadPool.java:451
)
at
jrunx.scheduler.ThreadPool$UpstreamMetrics.invokeR unnable(ThreadPool.java:29
4)
at jrunx.scheduler.WorkerThread.run(WorkerThread.java :66)

This is the query:

<cfquery name="getAll" datasource="#request.dsn#">
SELECT
U.userID, U.fname, U.lname, U.phone, U.lastLoggedIn,
U.choiceId, U.experience, R.label AS roleLabel, T.label AS teamLabel
FROM ((((User U INNER JOIN UserRoleAssoc URA on U.userID = URA.userID)
INNER JOIN role R on URA.roleID = R.roleID)
(LEFT JOIN UserTeamAssoc UTA ON UTA.userID = U.userID
INNER JOIN team t on T.teamID = UTA.teamID
)
)
ORDER BY #orderBy# #orderByTxt#
</cfquery>

Hm.m...

Phil
"Bob Quintal" <bq******@generation.net> wrote in message
news:3c******************************@news.teranew s.com...
"Phil Powell" <so*****@erols.com> wrote in
news:dP1ab.183646$xf.175404@lakeread04:
<cfquery name="getAll" datasource="#request.dsn#">
SELECT U.userID, U.fname, U.lname, U.phone,
U.lastLoggedIn,
U.choiceId, U.experience, T.label AS teamLabel,
R.label AS
roleLabel
FROM User U LEFT JOIN UserTeamAssoc UTA
ON UTA.userID = U.userID,
Role R, UserRoleAssoc URA, Team T
WHERE U.userID = URA.userID
AND URA.roleID = R.roleID
AND U.userId > 1
ORDER BY #orderBy# #orderByTxt#
</cfquery>

This query produces the following error:

Join expression not supported.

Has anyone else run into this problem, if so, what can I do
about it? I do not have the ability to install Access on my
machine so any solution could not involve working with Access
itself (I do have the .mdb file that I use via ColdFusion App
Server)

Phil


First you have no relation set from UTA to T. I've added what I
think you want
Second Access wants inner joins so marked, otherwise it produces
huge recordsets and then filters them through the where clause..

try:
From ((((User U INNER JOIN UserRoleAssoc URA
on U.userID = URA.userID)
INNER JOIN role R
on URA.roleID = R.roleID)
(LEFT JOIN UserTeamAssoc UTA
ON UTA.userID = U.userID
INNER JOIN team t
on T.teamID = UTA.teamID))

You may remove the now unnecessary where clauses.

If you get an error message try converting the last inner join to a
left join. Acess is sometimes picky about mixing inner and outer
joins.

Bob Q

Nov 12 '05 #12

P: n/a
"Phil Powell" <so*****@erols.com> wrote in message news:<dP1ab.183646$xf.175404@lakeread04>...
<cfquery name="getAll" datasource="#request.dsn#">
SELECT U.userID, U.fname, U.lname, U.phone, U.lastLoggedIn,
U.choiceId, U.experience, T.label AS teamLabel, R.label AS
roleLabel
FROM User U LEFT JOIN UserTeamAssoc UTA
ON UTA.userID = U.userID,
Role R, UserRoleAssoc URA, Team T
WHERE U.userID = URA.userID
AND URA.roleID = R.roleID
AND U.userId > 1
ORDER BY #orderBy# #orderByTxt#
</cfquery>

This query produces the following error:

Join expression not supported.


You're trying to use a variation of something like Oracle SQL on
Access. Ain't gonna work. Ever. All joins in Access are in the FROM
clause, not the WHERE clause. Try building the query in Access and
then porting/pasting to CF.
Nov 12 '05 #13

This discussion thread is closed

Replies have been disabled for this discussion.