syntax error near unexpected token `(‘

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";
This entry was posted in Database, Linux and tagged , , , , , , , by Hazem Saleh. Bookmark the permalink.

About Hazem Saleh

Hazem Saleh has more than eleven years of experience in Cloud, Mobile and Open Source technologies. He worked as a software engineer, technical leader, application architect, and technical consultant for many clients around the world. He is an Apache PMC (Project Management Committee) member and a person who spent many years of his life writing open source software. Beside being the author of the "JavaScript Unit Testing" book, "JavaScript Mobile Application Development" book, "Pro JSF and HTML5" book and the co-author of the "Definitive guide to Apache MyFaces" book, Hazem is also an author of many technical articles, a developerWorks contributing author and a technical speaker in both local and international conferences such as ApacheCon North America, Geecon, JavaLand, JSFDays, CON-FESS Vienna and JavaOne. Hazem is an XIBMer, he worked in IBM for ten years. Now, He is working for Nickelodeon New York as a Mobile Architect. He is also an OpenGroup Master Certified Specialist.

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

  1. 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!

Comments are closed.