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";

2 comments on “syntax error near unexpected token `(‘

  1. Good tip, this syntax error has happened to me many times in the past.

  2. I’m having this problem which I discovered on my error log file from my hosting. What I’m trying to do is backup my site with a pluging called wptwin. Every time I try it does not give the backup file it should creat so the I can download it to my PC. And I monitor everytime I do that task it give this error on my error log file (server).
    sh: -c: line 0: syntax error near unexpected token `(‘, referer: http://www.totallifechangesmlmrevolution.com/wptwin.php

    I will appreciate if someone could help me. It seems that there is a command that is not running well?

    Thanks!

Leave a reply

Your email address will not be published. Required fields are marked *

258,283 Spam Comments Blocked so far by Spam Free Wordpress

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>

Powered by sweetCaptcha