Menu

Error setting up sample data for Oracle DB

Help
Tracy
2008-05-13
2012-09-15
  • Tracy

    Tracy - 2008-05-13

    I've encountered an error running the sample setup script on my Oracle database:
    ../bin/sym -p root.properties --run-sql insert_sample.sql

    It's throwing an exception trying to insert a row into the SYM_TRIGGER table. The problem occurs with the first insert statement for SYM_TRIGGER (in insert_sample.sql) because the TRIGGER_ID is a "NOT NULL" column and the insert doesn't specify a value for TRIGGER_ID.

    How is the TRIGGER_ID supposed to be assigned? Is this a problem with the setup script or am I doing something wrong?

    Stacktrace:
    2008-05-13 10:44:49,056 INFO [org.jumpmind.symmetric.SymmetricEngine] [main] Initialized SymmetricDS externalId=0000 version=1.3.3 database=Oracle
    2008-05-13 10:44:49,667 ERROR [org.jumpmind.symmetric.db.SqlScript] [main] insert into sym_trigger (source_table_name, source_node_group_id, target_node_group_id, channel_id, sync_on_insert, sync_on_update, sync_on_delete, initial_load_order, last_updated_by, last_updated_time, create_time)values('item_selling_price', 'corp', 'store', 'item', 1, 1, 1, 100, 'demo', current_timestamp, current_timestamp) failed to execute.
    java.sql.SQLException: ORA-01400: cannot insert NULL into ("SYMMETRIC"."SYM_TRIGGER"."TRIGGER_ID")
    at oracle.jdbc.driver.DatabaseError.throwSqlException(DatabaseError.java:112)
    at oracle.jdbc.driver.T4CTTIoer.processError(T4CTTIoer.java:331)
    at oracle.jdbc.driver.T4CTTIoer.processError(T4CTTIoer.java:288)
    at oracle.jdbc.driver.T4C8Oall.receive(T4C8Oall.java:743)
    at oracle.jdbc.driver.T4CStatement.doOall8(T4CStatement.java:207)
    at oracle.jdbc.driver.T4CStatement.executeForRows(T4CStatement.java:946)
    at oracle.jdbc.driver.OracleStatement.doExecuteWithTimeout(OracleStatement.java:1168)
    at oracle.jdbc.driver.OracleStatement.executeInternal(OracleStatement.java:1687)
    at oracle.jdbc.driver.OracleStatement.execute(OracleStatement.java:1653)
    at org.apache.commons.dbcp.DelegatingStatement.execute(DelegatingStatement.java:261)
    at org.jumpmind.symmetric.db.SqlScript.executeScript(SqlScript.java:100)
    at org.jumpmind.symmetric.db.SqlScript.access$000(SqlScript.java:41)
    at org.jumpmind.symmetric.db.SqlScript$1.doInStatement(SqlScript.java:80)
    at org.springframework.jdbc.core.JdbcTemplate.execute(JdbcTemplate.java:343)
    at org.jumpmind.symmetric.db.SqlScript.execute(SqlScript.java:78)
    at org.jumpmind.symmetric.SymmetricLauncher.runSql(SymmetricLauncher.java:337)
    at org.jumpmind.symmetric.SymmetricLauncher.main(SymmetricLauncher.java:161)

    Any help is appreciated.

    -Tracy

     
    • Eric Long

      Eric Long - 2008-05-13

      During the "auto-create" step, it should have created a sequence and a trigger for that table, which populate the trigger_id. Were there any errors during that step? Were you missing permission to create sequences or triggers when you ran that step?

      Since you already have the table created, re-running the auto-create won't create the missing sequence or trigger. You need to drop the table, then run auto-create again. Another option is to create just the missing sequences and triggers. You can get the SQL used by the auto-create with this command:

      ../bin/sym -c ./create_sym.sql -p root.properties

      Eric

       
      • Tracy

        Tracy - 2008-05-13

        You were right on the money regarding the permissions; the sequence(s) did not exist. I dropped the SYMMETRIC account and recreated with all the known privileges, reran the setup, and everything looks good.

        Thanks again Eric. Sorry for all the novice questions.

         

Log in to post a comment.