| 3029 | } |
| 3030 | |
| 3031 | int msOracleSpatialLayerGetItems( layerObj *layer ) |
| 3032 | { |
| 3033 | char *rzt = ""; |
| 3034 | ub2 rzttype = 0; |
| 3035 | char *flk = ""; |
| 3036 | int function = 0; |
| 3037 | int version = 0; |
| 3038 | int existgeom; |
| 3039 | int count_item, flk_len, success, i; |
| 3040 | char *table_name; |
| 3041 | char query_str[6000], *geom_column_name = NULL, *unique = NULL, *srid = NULL; |
| 3042 | OCIParam *pard = (OCIParam *) 0; |
| 3043 | |
| 3044 | msOracleSpatialLayerInfo *layerinfo = (msOracleSpatialLayerInfo *) layer->layerinfo; |
| 3045 | msOracleSpatialDataHandler *dthand = NULL; |
| 3046 | msOracleSpatialHandler *hand = NULL; |
| 3047 | msOracleSpatialStatement *sthand = NULL; |
| 3048 | int get_field_details = 0; |
| 3049 | const char *value; |
| 3050 | |
| 3051 | if (layer->debug) |
| 3052 | msDebug("msOracleSpatialLayerGetItems was called.\n"); |
| 3053 | |
| 3054 | if (layerinfo == NULL) |
| 3055 | { |
| 3056 | msSetError( MS_ORACLESPATIALERR, "msOracleSpatialLayerGetItems called on unopened layer", "msOracleSpatialLayerGetItems()" ); |
| 3057 | return MS_FAILURE; |
| 3058 | } |
| 3059 | else |
| 3060 | { |
| 3061 | dthand = (msOracleSpatialDataHandler *)layerinfo->oradatahandlers; |
| 3062 | hand = (msOracleSpatialHandler *)layerinfo->orahandlers; |
| 3063 | sthand = (msOracleSpatialStatement *) layerinfo->orastmt; |
| 3064 | } |
| 3065 | |
| 3066 | /* Will we want to capture the field details? */ |
| 3067 | if((value = msOWSLookupMetadata(&(layer->metadata), "G", "types")) != NULL |
| 3068 | && strcasecmp(value,"auto") == 0 ) |
| 3069 | get_field_details = 1; |
| 3070 | |
| 3071 | table_name = (char *) malloc(sizeof(char) * TABLE_NAME_SIZE); |
| 3072 | if (!msSplitData(layer->data, &geom_column_name, &table_name, &unique, &srid, &function, &version)) |
| 3073 | { |
| 3074 | msSetError( MS_ORACLESPATIALERR, |
| 3075 | "Error parsing OracleSpatial DATA variable. Must be: " |
| 3076 | "'geometry_column FROM table_name [USING UNIQUE <column> SRID srid# FUNCTION]' or " |
| 3077 | "'geometry_column FROM (SELECT stmt) [USING UNIQUE <column> SRID srid# FUNCTION]'. " |
| 3078 | "If want to set the FUNCTION statement you can use: FILTER, RELATE, GEOMRELATE or NONE. " |
| 3079 | "Your data statement: %s", |
| 3080 | "msOracleSpatialLayerGetItems()", layer->data ); |
| 3081 | |
| 3082 | if (geom_column_name) free(geom_column_name); |
| 3083 | if (srid) free(srid); |
| 3084 | if (unique) free(unique); |
| 3085 | free(table_name); |
| 3086 | return MS_FAILURE; |
| 3087 | } |
| 3088 |
nothing calls this directly
no test coverage detected