Changes between Initial Version and Version 2 of Ticket #394


Ignore:
Timestamp:
Aug 6, 2008, 7:02:41 AM (16 years ago)
Author:
Mateusz Łoskot
Comment:

Legend:

Unmodified
Added
Removed
Modified
  • Ticket #394

    • Property Cc Mateusz Łoskot added
  • Ticket #394 – Description

    initial v2  
    1 {{{
    2 I started to use the OGR OCI driver from Mapserver, and I found some things in
    3 the driver that could be better:
     1I started to use the OGR OCI driver from Mapserver, and I found some things in the driver that could be better:
    42
    5 As far as I can tell, the driver does not give me the posibility to specify the
    6 feature_id column name. It seems that it is hardcoded to "OGR_FID" in the
    7 driver. So I created a view in Oracle with the OGR_FID column using my unique
    8 ID, but that didn't help - the driver does not support views. So I changed the
    9 ReadTableDefinition in ogrocitablelayer.cpp so that it supports views, and
    10 voila it works.
     3As far as I can tell, the driver does not give me the posibility to specify the feature_id column name. It seems that it is hardcoded to "OGR_FID" in the driver. So I created a view in Oracle with the OGR_FID column using my unique ID, but that didn't help - the driver does not support views. So I changed the
     4ReadTableDefinition in ogrocitablelayer.cpp so that it supports views, and voila it works.
    115
    126Here is the changed code from ogrocitablelayer.cpp, ReadTableDefinition:
    137
    148Original code:
    15     nStatus =
    16         OCIDescribeAny( poSession->hSvcCtx, poSession->hError,
    17                         (dvoid *) pszTable, strlen(pszTable), OCI_OTYPE_NAME,
    18                         OCI_DEFAULT, OCI_PTYPE_TABLE, poSession->hDescribe );
     9{{{
     10nStatus = OCIDescribeAny( poSession->hSvcCtx, poSession->hError, (dvoid *) pszTable, strlen(pszTable), OCI_OTYPE_NAME, OCI_DEFAULT, OCI_PTYPE_TABLE, poSession->hDescribe );
     11
     12if( poSession->Failed( nStatus, "OCIDescribeAny" ) )
     13    return poDefn;
     14}}}
     15
     16Changed code:
     17{{{
     18nStatus = OCIDescribeAny( poSession->hSvcCtx, poSession->hError, (dvoid *) pszTable, strlen(pszTable), OCI_OTYPE_NAME, OCI_DEFAULT, OCI_PTYPE_TABLE, poSession->hDescribe );
     19
     20if( poSession->Failed( nStatus, "OCIDescribeAny" ) )
     21{
     22    nStatus = OCIDescribeAny( poSession->hSvcCtx, poSession->hError, (dvoid *) pszTable, strlen(pszTable), OCI_OTYPE_NAME, OCI_DEFAULT, OCI_PTYPE_VIEW, poSession->hDescribe );
     23
    1924    if( poSession->Failed( nStatus, "OCIDescribeAny" ) )
    2025        return poDefn;
    21 
    22 Changed code:
    23     nStatus =
    24         OCIDescribeAny( poSession->hSvcCtx, poSession->hError,
    25                         (dvoid *) pszTable, strlen(pszTable), OCI_OTYPE_NAME,
    26                         OCI_DEFAULT, OCI_PTYPE_TABLE, poSession->hDescribe );
    27     if( poSession->Failed( nStatus, "OCIDescribeAny" ) )
    28       {
    29         nStatus =
    30             OCIDescribeAny( poSession->hSvcCtx, poSession->hError,
    31                         (dvoid *) pszTable, strlen(pszTable), OCI_OTYPE_NAME,
    32                         OCI_DEFAULT, OCI_PTYPE_VIEW, poSession->hDescribe );
    33         if( poSession->Failed( nStatus, "OCIDescribeAny" ) )
    34           return poDefn;
    35       }
    36 
     26}
     27}}}
    3728
    3829Best regards Lars Loldrup
    39 }}}