All Forums Connectivity
sundarvenkata 7 posts Joined 11/12
20 Jul 2013
.NET Data provider - Canonical functions support

Alright. So I looked at this page: http://developer.teradata.com/doc/connectivity/ tdnetdp/14.10/webhelp/ EntityProviderCanonicalFunctions.html. It mentions that canonical functions for .NET 4.0 are supported under the "Teradata" namespace. Where in the world is this namespace? I have referenced Teradata.Client.Entity.Dll, Teradata.Client.Provider.Dll, Teradata.Client.Provider.Resources.Dll. None of these is helping me find the elusive "Teradata" namespace. Please help. I have already wasted countless hours on this!
 
Thanks,
Sundar

dnoeth 4628 posts Joined 11/04
20 Jul 2013

Hi Sundar,
i'm not a .NET programmer, but when i looked at the link you provided i found 

For example, to execute a .NET Framework 4.0 supported EndsWith(SearchString, TargetString) function, prepend Teradata to the command (Entity SQL command below)

plus an example how to use it 

SELECT e.CompanyName, Teradata.EndsWith(e.CompanyName, "d")
FROM NorthwindEntities.Customers AS e order by e.customerId

So, did you try to add "Teradata." in front of the name?
 
Dieter

Dieter

sundarvenkata 7 posts Joined 11/12
20 Jul 2013

Yes. Of course, the query won't compile in that case. Error message: The type or namespace name 'DiffDays' does not exist in the namespace 'Teradata'.

dnoeth 4628 posts Joined 11/04
20 Jul 2013

Hi Sundar,
sorry that i asked such a basic thing, but some people don't really read documentation :-)
IMHO it should be in Teradata.Client.Provider, what if you try any other function from that namespace?
 
Of course, you could replace that all those .NET function with a generic TD function.
 
Dieter 

Dieter

sundarvenkata 7 posts Joined 11/12
21 Jul 2013

>>>Of course, you could replace that all those .NET function with a generic TD function.
What do you mean by that? The canonical functions are expressly provided by Teradata to interoperate with the Entity Framework. I cannot replace that with any function of my own.

sundarvenkata 7 posts Joined 11/12
21 Jul 2013

This is so frustrating...... I worked so hard over the past few weeks to get LINQPad to query a Teradata data source only to learn that the canonical functions can only be used in Entity SQL and not in "LINQ to entities". What a lousy artificial limitation....

dnoeth 4628 posts Joined 11/04
26 Jul 2013

Hi Sundar,
sorry for the late answer.
With "replace" i ment you could write it directly using Teradata SQL, afaik the .NET provider simply translates all those functions to valid Teradata SQL
e.g. DiffDays(date1, date2) = date2 - date1
Of course this means database specific code again...
 
Dieter

Dieter

You must sign in to leave a comment.