BookmarkSubscribeRSS Feed
CClapp
Calcite | Level 5

Hi,

 

I hope you can help.  I have a LEFT join as part of my JOIN transformation, and although the job runs to completion, when I try to open the results for the temporary work table the following error is displayed:

 

Unable to execute query: SQL passthru expression contained these errors: ERROR: Correlated reference to column CourtesyTitleID is not contained within a subquery.

 

If I change the join to an INNER join it works.

 

I am connecting to our MS SQL Server 2012 database via ODBC.

 

Any ideas?

 

Cheers!

2 REPLIES 2
LinusH
Tourmaline | Level 20
Perhaps you have the default setting of creating a view os transformation output? There cab be some errors that isn't discovered until view execution. Uncheck the view option and try again.

When going from/to outer and inner joins you need to consider the implicit join criteria. DI Studio does not automatically change the Join criteria (between where in inner join to on when outer join is chosen).
Data never sleeps
SASKiwi
PROC Star

I've seen this error recently with manually written SQL and I managed to fix it by moving the query providing the column mentioned in the error before the sub-query. You shouldn't have to do this with SQL as it should be order insensitive.

 

Are you able to do that in DI? If possible can you post the log containing the generated code with the error?

sas-innovate-2024.png

Don't miss out on SAS Innovate - Register now for the FREE Livestream!

Can't make it to Vegas? No problem! Watch our general sessions LIVE or on-demand starting April 17th. Hear from SAS execs, best-selling author Adam Grant, Hot Ones host Sean Evans, top tech journalist Kara Swisher, AI expert Cassie Kozyrkov, and the mind-blowing dance crew iLuminate! Plus, get access to over 20 breakout sessions.

 

Register now!

How to connect to databases in SAS Viya

Need to connect to databases in SAS Viya? SAS’ David Ghan shows you two methods – via SAS/ACCESS LIBNAME and SAS Data Connector SASLIBS – in this video.

Find more tutorials on the SAS Users YouTube channel.

Discussion stats
  • 2 replies
  • 922 views
  • 0 likes
  • 3 in conversation