Select to view content in your preferred language

Cast shape number field to string

747
6
06-11-2012 10:05 AM
gilKrips
New Contributor
Hi, i'm trying to cast a numeric field in a shapefile feature class to string.
I tried writing "CAST("fid" as char(20)) like '%50%'" and expected it to return featues that the fid value contains the request digits but it does not seem to work.
Any suggestions?
0 Kudos
6 Replies
VinceAngelo
Esri Esteemed Contributor
Shapefiles aren't SQL entities -- they don't support a cast function (I don't think
file geodatabase supports casting either). For ArcSDE tables the exact syntax
would differ by RDBMS.

- V
0 Kudos
gilKrips
New Contributor
Understood, i'll do it the old fashion way with cursor..
Thanks
0 Kudos
LanceShipman
Esri Regular Contributor
File Geodatabase does support CAST.
0 Kudos
gilKrips
New Contributor
File Geodatabase does support CAST.


Yes i know that.. i just didn't knew how to cast shapes or if its even possible
I see now that its not so ill run on the features with a search cursor and search manually.
with sde, gdb and mdb i am good
thank you
0 Kudos
gilKrips
New Contributor
0 Kudos
DuncanHornby
MVP Notable Contributor

Michelle Mathias‌ can you resurrect the thread that "gil Krips" found as I need to see the answer as it may solve my problem.

0 Kudos