gflewis / sndml3

ServiceNow Data Mart Loader: an application to load SQL databases from ServiceNow
MIT License
30 stars 19 forks source link

Database Views are not replicated #32

Closed nandhaece07 closed 2 years ago

nandhaece07 commented 2 years ago

I was trying to replicate the database views table data into MSSQL database but am getting the following error.

==== 05:06:35 ERROR AppJobRunner [DPRUN0001055] DPRUN0001055 ERROR: sndml.daemon.AppJobRunner.call: sndml.servicenow.NoContentException sndml.servicenow.NoContentException: GET https://dev109575.service-now.com/api/x_108443_sndml/gettableschema/incident_time_worked HTTP/1.1 404 Not Found RESPONSE:

    at sndml.servicenow.JsonRequest.executeRequest(JsonRequest.java:134) ~[sndml-3.4.4-mssql.jar:?]
    at sndml.servicenow.JsonRequest.execute(JsonRequest.java:44) ~[sndml-3.4.4-mssql.jar:?]
    at sndml.daemon.AppSchemaFactory.getSchema(AppSchemaFactory.java:30) ~[sndml-3.4.4-mssql.jar:?]
    at sndml.servicenow.Session.getSchema(Session.java:197) ~[sndml-3.4.4-mssql.jar:?]
    at sndml.servicenow.Table.getSchema(Table.java:115) ~[sndml-3.4.4-mssql.jar:?]
    at sndml.datamart.Generator.getCreateTable(Generator.java:262) ~[sndml-3.4.4-mssql.jar:?]
    at sndml.datamart.Database.createTable(Database.java:256) ~[sndml-3.4.4-mssql.jar:?]
    at sndml.datamart.Database.createMissingTable(Database.java:301) ~[sndml-3.4.4-mssql.jar:?]
    at sndml.datamart.JobRunner.runLoad(JobRunner.java:190) ~[sndml-3.4.4-mssql.jar:?]
    at sndml.datamart.JobRunner.call(JobRunner.java:99) ~[sndml-3.4.4-mssql.jar:?]
    at sndml.daemon.AppJobRunner.call(AppJobRunner.java:85) [sndml-3.4.4-mssql.jar:?]
    at sndml.daemon.AppJobRunner.run(AppJobRunner.java:60) [sndml-3.4.4-mssql.jar:?]
    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1136) [?:?]
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:635) [?:?]
    at java.lang.Thread.run(Thread.java:833) [?:?]

05:06:35 ERROR AppStatusLogger [DPRUN0001055] DPRUN0001055 PROCESS: logError NoContentException

I have tried the following but still error remains same.

  1. Created Cross-application scope access to this table with Source scope: Datapump, Dest Scope: Global, Target Type: Table and Target Name: tablename
  2. Given all permission to the databump daemon user in dev environment to test
gflewis commented 2 years ago

SNDML cannot replicate ServiceNow database views. There are a couple of reasons for this. (1) There is no schema information in ServiceNow for database views. (2) There is no way to determine when a row was last updated.

The recommendation is that you replicate the underlying tables, and recreate the view in the target SQL database.

nandhaece07 commented 2 years ago

Thanks @gflewis for the quick update and suggestion!