Table Adapter’s Config. error for DB2 SQL statements containing a CASE expression.

mendezedd

New member
Joined
Sep 20, 2011
Messages
2
Programming Experience
5-10
Hi: I am having a situation using .NET’s Table Adapter’s Configuration Wizard when designing DB2 SQL statements containing a CASE expression within it.

I was previously using the ODBC provider method for DB2; once I changed to the DB2 Provider for .NET every single Query that uses a CASE expression stopped parsing, so I am not able to modify or recreate them. I’m not even able to create new ones.



Sample Query:

SELECT ORGANIZATION_CODE,

CASE WHEN COUNTRY_CODE = 'NY' THEN 'NEW YORK'

WHEN COUNTRY_CODE = 'PR'THEN 'PUERTO RICO'

ELSE 'EXTERIOR'

END AS SOURCE

FROM SIUSER.HOLIDAYS_TABLE



If I eliminate de CASE Expression it would parse, execute and have no problem at all.



SELECT ORGANIZATION_CODE,

COUNTRY_CODE

FROM SIUSER.HOLIDAYS_TABLE


Any suggestions would be appreciated!!,



Best regards,



Eduardo
 
The fact that the Query Builder can't parse your SQL code doesn't necessarily mean that it won't work. I can't speak for every case but I've added a query to a TableAdapter for Access containing:
VB.NET:
SELECT @@IDENTITY
It could not be parsed but it still worked.
 
RE:.NET's Query Builder can't parse DB2 SQL code

The fact that the Query Builder can't parse your SQL code doesn't necessarily mean that it won't work. I can't speak for every case but I've added a query to a TableAdapter for Access containing:
VB.NET:
SELECT @@IDENTITY
It could not be parsed but it still worked.


Hi jmcilhinney and thanks a lot for your answer. I agree with you that there are cases in which not parsing doesn’t necessary means that it won’t work or execute; a have even seen some of those cases before, and I am aware of it. However the situation that I have right now won’t let me finish creating the fill method, so when I try to retrieve those fill methods belonging to the implicated Table Adapter; they are not even accessible. So this is like being stock there. I really have no option right now to make them work.

Thanks again.

Any other suggestions from you as well as from any other participant will be strongly appreciated.

Eduardo.
 
Back
Top