Syntax error

Post Reply
MiniMe
Posts: 210
Joined: Thu Mar 15, 2001 4:30 pm

Syntax error

Post by MiniMe »

Can anyone tell me how to get this command to work.. It keeps throwing an error in every variation I have tried.

tsql 'set indexspace="/db/indexes/prod/";create metamorph index xlanguageworks on works("LANGUAGE")'
Texis Version 04.02.1033654782(20021003) Copyright (c) 1988-2002 Thunderstone EPI

100 Could not find field db/indexes/prod/ in the function Evaluate
015 Metamorph index xlanguageworks is already being created on works(LANGUAGE)
000 SQL failed
User avatar
mark
Site Admin
Posts: 5519
Joined: Tue Apr 25, 2000 6:56 pm

Syntax error

Post by mark »

You have to use single quote within sql, so you have to use double quote around the whole thing for the shell.

tsql "set indexspace='/db/indexes/prod/';create metamorph index xlanguageworks on works(LANGUAGE)"

The second message indicates that some other process is already working on making that index. If that process is not running and was killed without being allowed to cleanup you'll need to drop the index first.
MiniMe
Posts: 210
Joined: Thu Mar 15, 2001 4:30 pm

Syntax error

Post by MiniMe »

But now I get this instead..

bash-2.04# tsql "set indexspace='/db/indexes/prod/';create metamorph index xlanguageworks on works(LANGUAGE)"
Texis Version 04.02.1033654782(20021003) Copyright (c) 1988-2002 Thunderstone EPI

015 Line 1: syntax error at "LANGUAGE"
015 CREATE [UNIQUE | METAMORPH | INVERTED] INDEX index-name
ON table-name
(column-name [DESC])
000 SQL failed
User avatar
mark
Site Admin
Posts: 5519
Joined: Tue Apr 25, 2000 6:56 pm

Syntax error

Post by mark »

Sorry, forgot LANGUAGE is a reserved word. You need to put double quotes around it. Use backslash to protect them from the shell

tsql "set indexspace='/db/indexes/prod/';create metamorph index xlanguageworks on works(\"LANGUAGE\")"

We recommend using Mixed Case field names to avoid possible reserved word conflicts. Keywords are only all UPPERCASE or all lowercase.
MiniMe
Posts: 210
Joined: Thu Mar 15, 2001 4:30 pm

Syntax error

Post by MiniMe »

Ah.. I didn't think of escaping the quotes..thanks for your help.
Post Reply