Siebel SQLs/Error Messages >  Generate New Database Template (GenNewDB) task fails with SBL-GDB-00004 and 'Syntax error'

Generate New Database Template (GenNewDB) task fails with SBL-GDB-00004 and 'Syntax error'

APPLIES TO:
Siebel CRM - Version 8.2.2.14.16 [IP2014] and later
Information in this document applies to any platform.
SYMPTOMS
Siebel Remote / Replication / Anywhere - on version: 8.1.1.14.16 / 8.2.2.14.16 [IP2014]

On a Development environment, the Generate New Database Template (GenNewDB) task completes with the generic error:

ERROR
-----------------------
"SBL-GDB-00004: Error in Main function."


STEPS
-----------------------
The issue can be reproduced at will with the following steps:
1. Setup Remote / MobileSync components on the Siebel environment
2. start / schedule a GenNewDB component task
3. see that completing with error

CAUSE
The cause of the issue here was an invalid / incorrect Name for a custom Index created in Siebel Tools:

...
SQLError Statement 0 0000000257dfa6dc:0 2016-09-19 14:32:02 SQL Statement:
create index CX_SRQ_FEES_XM _M1 on CX_SRQ_FEES_XM
(TYPE, NAME)
DBCLog DBCLogError 1 0000000257dfa6dc:0 2016-09-19 14:32:02 [Sybase][ODBC Driver][Adaptive Server Anywhere]Syntax error near '_M1' on line 1
GenericLog GenericError 1 0000000257dfa6dc:0 2016-09-19 14:32:02 SQL Message, 37000: [Siebel Database][ODBC Driver][Adaptive Server Anywhere]Syntax error near '_M1' on line 1
...

One can observe there was an extra space char in Index name:

create index
CX_SRQ_FEES_XM _M1 << -- a space exists between Table name and "_M1"
on CX_SRQ_FEES_XM

SOLUTION
These 'Syntax errors' in general -

[Sybase][ODBC Driver][Adaptive Server Anywhere]Syntax error near (...) on line ()

are caused most of the time by invalid DDL statements generated - as result of Siebel schema customizations for tables or indexes in Siebel Tools; either being generated by names or options for those objects or data types restrictions from SQL Anywhere database perspective.

However, in order to resolve this issue, following steps should be applied:

1- Ask the Developer team to correct that custom object definition - in current case - the index "CX_SRQ_FEES_XM _M1" to remove that space - i.e. "CX_SRQ_FEES_XM_M1".
(In general, this step would depend on the object involved and the exact Syntax error line details.)

2- Apply and Activate schema changes on the Siebel Repository;
3- Stop Siebel Server service, locate and (re-)move the diccache.dat and dicdata.dat from the [SIEBEL_ROOT]/siebsrvr/bin directory (- a backup copy of those could be kept until seeing those are regenerated);
4- Restart Siebel server so diccache.dat file would be recreated; (dicdata.dat would be only generated when running GenNewDB task).
5- Retry now the GenNewDB task and confirm if that is now completing fine.
6- If having any Mobile/Developer clients already extracted, please re-extract and re-initialize all their local DBFs after completing the above steps.