Select to view content in your preferred language

Selecting by Attributes using "MID": Personal GDB vs SDE

790
2
12-08-2011 07:39 AM
ScottGowan
Occasional Contributor
Greetings all,

Within ArcMAP using a feature class in a personal GDB, I originally used this query for selecting from a text field using the "select by attributes" tool and it work correctly:

MID (StationRunOrder,1,1) = "4" OR MID (StationRunOrder,3,1) = "4"

Running the same query on this features class after it was imported to SDE the same query returns the error:

There was an error with expression.  Underlying DBMS error[ORA-0094: "4": invalid identifier]

The fields I'm selecting from are defined the same in both cases.  I suspect it's simply a syntax issue.  Any help would be greatly appreciated.

Regards,

Scott
0 Kudos
2 Replies
VinceAngelo
Esri Esteemed Contributor
What does "MID()" do?  You need to use the equivalent Oracle SQL function.

- V
0 Kudos
ScottGowan
Occasional Contributor
What does "MID()" do?  You need to use the equivalent Oracle SQL function.

- V


You were right on.

The equivalent in Oracle is substr (sub string).  I'm pulling out values from the string in the first three postions when they're '?', which ever value I want.   '7' in this case.

The revised query was:
substr (StationRunOrder,1,1) = '7' OR substr (StationRunOrder,3,1) = '7'

Thanks.  Scott
0 Kudos