Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-8198876

Loading a shapefile into Oracle DB 12c (12.1.0) via SampleShapefileToJGeomFeature

    Details

    • Type: Bug
    • Status: Closed
    • Priority: P4
    • Resolution: Not an Issue
    • Affects Version/s: 6u45
    • Fix Version/s: None
    • Component/s: core-libs
    • Subcomponent:
    • CPU:
      x86
    • OS:
      other

      Description

      FULL PRODUCT VERSION :


      A DESCRIPTION OF THE PROBLEM :
      While trying to load a shapefile into Oracle DB via command line as:

      set ORACLE_HOME=D:\app\product\12.1.0\dbhome_1

      java -classpath %ORACLE_HOME%\jdbc\lib\ojdbc6.jar;%ORACLE_HOME%\md\jlib\sdoutl.jar;%ORACLE_HOME%\md\jlib\sdoapi.jar oracle.spatial.util.SampleShapefileToJGeomFeature -h localhost -p 1521 -s TESTDB -u MYUSER -d mypass -t oria -a -f oria_01-02-2018 -r 4326 -g geom

      I get
      java.sql.SQLSyntaxErrorException: ORA-00902: invalid datatype

      Same happens if I use the map_builder-12.2.1.3.0.jar tool

      STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
      The problem is that one column in the table contains special characters. In my case it is the column named e-mail and the utility fails to create the table. As a result every record is not converted.




      ERROR MESSAGES/STACK TRACES THAT OCCUR :
      java.sql.SQLSyntaxErrorException: ORA-00902: invalid datatype

      java.sql.SQLSyntaxErrorException: ORA-00942: table or view does not exist

      Record #1 not converted.
      java.sql.SQLSyntaxErrorException: ORA-00942: table or view does not exist

      ...

      Record #292 not converted.
      292 record(s) not converted.
      0 record(s) converted.
      Done.


      REPRODUCIBILITY :
      This bug can be reproduced always.

      ---------- BEGIN SOURCE ----------
      Any shapefile with a column name containing the - character. It needs double quotes during creation of the table.
      ---------- END SOURCE ----------

      CUSTOMER SUBMITTED WORKAROUND :
      I loaded the shapefile in Postgres and it loaded successfully. I checked the table created and it contained a column named "e-mail". So, the workaround was to actually create the table in the Oracle DB first and use the -a (append) option to load the data successfully.

        Attachments

          Activity

            People

            • Assignee:
              psonal Pallavi Sonal (Inactive)
              Reporter:
              webbuggrp Webbug Group
            • Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: