Changeset 6759

Show
Ignore:
Timestamp:
11/08/04 21:49:12 (4 years ago)
Author:
fwarmerdam
Message:

Don't add user_sdo_geom_metadata record till finalize (layer load complete)
time as that is when we have all the diminfo details. Inserts of metadata
records with NULL diminfos fails in Oracle 10 due to new constraints.

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/ogr/ogrsf_frmts/oci/ogrocidatasource.cpp

    r6280 r6759  
    2929 * 
    3030 * $Log$ 
     31 * Revision 1.24  2004/11/09 02:49:12  fwarmerdam 
     32 * Don't add user_sdo_geom_metadata record till finalize (layer load complete) 
     33 * time as that is when we have all the diminfo details.  Inserts of metadata 
     34 * records with NULL diminfos fails in Oracle 10 due to new constraints. 
     35 * 
    3136 * Revision 1.23  2004/07/09 07:07:39  warmerda 
    3237 * Added OGRSQL dialect support. 
     
    506511 
    507512/* -------------------------------------------------------------------- */ 
    508 /*      Add the table to the user_sdo_geom_metadata table without       */ 
    509 /*      setting the dimension information.  Do that later when          */ 
    510 /*      requesting an index to be built.                                */ 
    511 /* -------------------------------------------------------------------- */ 
    512  
    513     sprintf( szCommand,  
    514              "INSERT INTO USER_SDO_GEOM_METADATA VALUES " 
    515              "( '%s', '%s', NULL, %s )",  
    516              pszSafeLayerName, "ORA_GEOMETRY", szSRSId ); 
    517  
    518     oStatement.Execute( szCommand ); 
    519  
    520 /* -------------------------------------------------------------------- */ 
    521513/*      Create the layer object.                                        */ 
    522514/* -------------------------------------------------------------------- */ 
  • trunk/ogr/ogrsf_frmts/oci/ogrocitablelayer.cpp

    r6605 r6759  
    3131 * 
    3232 * $Log$ 
     33 * Revision 1.29  2004/11/09 02:49:12  fwarmerdam 
     34 * Don't add user_sdo_geom_metadata record till finalize (layer load complete) 
     35 * time as that is when we have all the diminfo details.  Inserts of metadata 
     36 * records with NULL diminfos fails in Oracle 10 due to new constraints. 
     37 * 
    3338 * Revision 1.28  2004/09/28 17:19:25  fwarmerdam 
    3439 * Added untested support for OCI_FID config variable for FID column name. 
     
    12311236/*      Prepare dimension update statement.                             */ 
    12321237/* -------------------------------------------------------------------- */ 
    1233     sDimUpdate.Append( "UPDATE USER_SDO_GEOM_METADATA SET DIMINFO = " ); 
     1238    sDimUpdate.Append( "INSERT INTO USER_SDO_GEOM_METADATA VALUES " ); 
     1239    sDimUpdate.Appendf( strlen(poFeatureDefn->GetName()) + 100, 
     1240                        "('%s', 'ORA_GEOMETRY', ", 
     1241                        poFeatureDefn->GetName() ); 
     1242 
    12341243    sDimUpdate.Append( "MDSYS.SDO_DIM_ARRAY(" ); 
    1235  
    12361244    sDimUpdate.Appendf(200, 
    12371245                       "MDSYS.SDO_DIM_ELEMENT('X',%.16g,%.16g,%.12g)", 
     
    12481256    } 
    12491257 
    1250     sDimUpdate.Append( ")" ); 
    1251  
    1252     sDimUpdate.Appendf( strlen(poFeatureDefn->GetName()) + 100, 
    1253                         " WHERE table_name = '%s'",  
    1254                         poFeatureDefn->GetName() ); 
     1258    if( nSRID == -1 ) 
     1259        sDimUpdate.Append( "), NULL)" ); 
     1260    else 
     1261        sDimUpdate.Appendf( 100, "), %d)", nSRID ); 
    12551262 
    12561263/* -------------------------------------------------------------------- */