Changeset 13843

Show
Ignore:
Timestamp:
02/22/08 18:59:04 (3 months ago)
Author:
tamas
Message:

Prevent from calling CPLError when SDO_GEOMETRY is missing (non spatial) (#2202)

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • branches/1.5/gdal/ogr/ogrsf_frmts/oci/ogrocisession.cpp

    r13450 r13843  
    157157/*      Try to get the MDSYS.SDO_GEOMETRY type object.                  */ 
    158158/* -------------------------------------------------------------------- */ 
    159     hGeometryTDO = PinTDO( SDO_GEOMETRY ); 
    160     if( hGeometryTDO == NULL ) 
    161         return FALSE; 
     159    /* If we have no MDSYS.SDO_GEOMETRY then we consider we are 
     160        working along with the VRT driver and access non spatial tables. 
     161        See #2202 for more details (Tamas Szekeres)*/ 
     162    if (OCIDescribeAny(hSvcCtx, hError,  
     163                       (text *) SDO_GEOMETRY, (ub4) strlen(SDO_GEOMETRY),  
     164                       OCI_OTYPE_NAME, (ub1)1, (ub1)OCI_PTYPE_TYPE,  
     165                       hDescribe ) != OCI_ERROR) 
     166    { 
     167        hGeometryTDO = PinTDO( SDO_GEOMETRY ); 
     168        if( hGeometryTDO == NULL ) 
     169            return FALSE; 
    162170 
    163171/* -------------------------------------------------------------------- */ 
    164172/*      Try to get the MDSYS.SDO_ORDINATE_ARRAY type object.            */ 
    165173/* -------------------------------------------------------------------- */ 
    166     hOrdinatesTDO = PinTDO( "MDSYS.SDO_ORDINATE_ARRAY" ); 
    167     if( hOrdinatesTDO == NULL ) 
    168         return FALSE; 
     174        hOrdinatesTDO = PinTDO( "MDSYS.SDO_ORDINATE_ARRAY" ); 
     175        if( hOrdinatesTDO == NULL ) 
     176            return FALSE; 
    169177 
    170178/* -------------------------------------------------------------------- */ 
    171179/*      Try to get the MDSYS.SDO_ELEM_INFO_ARRAY type object.           */ 
    172180/* -------------------------------------------------------------------- */ 
    173     hElemInfoTDO = PinTDO( "MDSYS.SDO_ELEM_INFO_ARRAY" ); 
    174     if( hElemInfoTDO == NULL ) 
    175         return FALSE; 
    176  
     181        hElemInfoTDO = PinTDO( "MDSYS.SDO_ELEM_INFO_ARRAY" ); 
     182        if( hElemInfoTDO == NULL ) 
     183            return FALSE; 
     184    } 
    177185/* -------------------------------------------------------------------- */ 
    178186/*      Record information about the session.                           */