You are browsing the archive for create index.

syntax error near unexpected token `(‘

August 4, 2012 in Database, Linux

You may face this issue when you try to execute a command on the Linux shell. I faced this issue when trying to execute the following DB2 command on the server Linux server using the putty shell:

db2text create index someindex for text on someTable(someField) CONNECT TO someDB;

In order to fix this issue, I have to set \ before every ( as shown below:

db2text create index someindex for text on someTable\(someField\) CONNECT TO someDB;

Another solution is to add double quotes on the command as follows:

db2text "create index someindex for text on someTable(someField) CONNECT TO someDB";
Skip to toolbar