String functions resulting in SQL syntax errors?

Discussion of open issues, suggestions and bugs regarding ADO.NET provider for Cloud Applications
Post Reply
MBray
Posts: 8
Joined: Tue 21 Jan 2014 15:43

String functions resulting in SQL syntax errors?

Post by MBray » Wed 13 Aug 2014 20:33

I have a simple query that has a where clause that needs to examine the first two characters of one of the table fields. For example,

SELECT
myfield1,
myfield2,
myfield3
from
mytable
WHERE
LEFT(myfield, 2) = 'XX'


This results in the following error:

You have an error in your SQL syntax at line 8, column 2: Unexpected symbol 'LEFT'.

Are functions supported? If so, can someone help me understand the syntax problem with the query referenced above?

Shalex
Site Admin
Posts: 9543
Joined: Thu 14 Aug 2008 12:44

Re: String functions resulting in SQL syntax errors?

Post by Shalex » Thu 14 Aug 2014 10:58

Could you please try using the following query instead?

Code: Select all

SELECT 
myfield1, 
myfield2, 
myfield3 
from 
mytable 
WHERE 
myfield LIKE 'XX%'

MBray
Posts: 8
Joined: Tue 21 Jan 2014 15:43

Re: String functions resulting in SQL syntax errors?

Post by MBray » Thu 14 Aug 2014 13:56

Thanks for the reply, Shalex. Just for my own understanding...are SQL functions not supported? If so, are there certain functions that are supported and others not?

Shalex
Site Admin
Posts: 9543
Joined: Thu 14 Aug 2008 12:44

Re: String functions resulting in SQL syntax errors?

Post by Shalex » Fri 15 Aug 2014 08:34

The only functions which are supported at the moment are AVG, COUNT, MIN, MAX, SUM.

Post Reply