Click here to Skip to main content
15,881,882 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Dear Frnds,

I have developed one web application Screen connected with mySql database. i got error at run time.

MySql.Data.MySqlClient.MySqlException: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'int)),0)+1 FROM MED_MASTER' at line 1

Any function not supported in this function:
SELECT isnull(Max(cast(substring(Medcode,charindex('',Medcode)+1,len(Medcode)) as int)),0)+1 FROM MED_MASTER


with Regards,
Vno
Posted

1 solution

I haven't touched MySQL in quite some time but I believe the issue is that MySQL doesn't support the full data type range in the CAST() function.

I believe you would have to use CAST( value AS SIGNED ) instead of INT as you're using in your example.

The MySQL CAST() Function documentation can be found at http://dev.mysql.com/doc/refman/5.0/en/cast-functions.html#function_cast[^]
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900