An unexpected NULL value was returned for column

More
2 years 2 months ago #14572 by agargye
We are evaluating the PGNP OLEDB Providers for Postgres (64bit) SE Version for via linked server connection

We get this error on a column from a table in a left join when no records are returned in the left join table TBL3. There is no error when TBL3 finds records for the join condition

This returns results with the ODBC Drive on the PostgreSQL site in both above situations. Why is the LEFT JOIN throwing this error and what is the solution if any?

e.g.
Select
A.Col1
,A.Col2
,A.Col3
,B.Col4
,SUM(C.Col5) Col5
from
TBL1 A
INNER JOIN TBL2 B
ON A.Col1 = B.Col1
TBL1 A
LEFT JOIN TBL3 C
ON A.Col1 = C.Col1
GROUP BY
A.Col1
,A.Col2
,A.Col3

Please Log in or Create an account to join the conversation.

More
2 years 2 months ago #14573 by admin
This is happening because of the Trial version limitations (100 rows).
The following user(s) said Thank You: agargye

Please Log in or Create an account to join the conversation.

More
2 years 2 months ago #14574 by agargye
I'm not sure I understand completely:

Why will the trial version NOT return data when a record is found in the left join table and result in the NULL error when no matching record is found.

In both cases the result set expects to return 1 record and a ZERO value when no match record exists

Please Log in or Create an account to join the conversation.

More
2 years 2 months ago #14575 by admin
I assumed that one of the tables is from the SQL Server and others are from the linked server. Since Trial version returns not more than 100 rows, there could be NULLs where they are normally not expected (because no matching condition is fulfilled). I would recommend running PGNProfiler as Administrator and collecting internal trace for the linked server. The trace might contain additional info on how the query was executed.

Please Log in or Create an account to join the conversation.

Time to create page: 0.142 seconds
Powered by Kunena Forum