.Net provider

Connectivity
Enthusiast

.Net provider

I'm trying to run query from SQL2005.

When I run the query in ODBC driver it works fine, but the .NET syntax will not take it.

the function I'm trying to use is:

SUBSTRING(field,x,y)

Has anybody had any luck using substring to get parts of field using the .NET driver?

Thank you.

Leo
1 REPLY

Re: .Net provider

The syntax of your SUBSTRING function is not accepted by Teradata.

A sql statement that contains "SUBSTRING(field, x, y)" will work with the ODBC driver because it will modify the SUBSTRING function to the syntax that can be processed by Teradata.

The .Net Data Provider for Teradata does not modify the sql statement contained in the CommandText. So if you execute the command, an exception will get thrown that indicates that the sql statement contains a syntax error.

The syntax of the substring function will have to be changed to

SUBSTRING(field FROM x FOR y)

if you want to use the Teradata provider.

--Dave S.