Informix Sql Error Code 201
Contents |
on), keywords misspelled (such as 4gl error codes VALEUS for VALUES), keywords misused (such as SET in an INSERT
Forms Statement Error Number
statement or INTO in a subquery), keywords out of sequence (such as a condition of "value IS
Informix Sqlcode
NOT" instead of "NOT value IS"), or a reserved word used as an identifier. Database servers that provide full NIST compliance do not reserve any words; queries that work with these database servers might fail and finderr return error -201 when they are used with earlier versions of IBM Informix database servers.
The cause of this error might be an attempt to use round-robin syntax with CREATE INDEX or ALTER FRAGMENT INIT on an index. You cannot use round-robin indexes. The error may also occur if an SQL statement uses double quotation marks around input strings and the environment variable DELIMIDENT is set. If DELIMIDENT is set, strings that are surrounded by double quotation marks are regarded as SQL identifiers rather than string literals. For more information on the usage of DELIMIDENT, see the IBM Informix Guide to SQL: Reference.here for a quick overview of the site Help Center Detailed answers to any questions you might have Meta Discuss the workings and policies of this site http://stackoverflow.com/questions/11251060/informix-error-a-syntax-error-has-occurred-error-code-201 About Us Learn more about Stack Overflow the company Business Learn more about hiring developers or posting ads with us Stack Overflow Questions Jobs Documentation Tags Users Badges Ask Question x Dismiss Join the Stack Overflow Community Stack Overflow is a community of 4.7 million programmers, just like you, helping each other. Join them; it only takes a minute: Sign up Informix ERROR: A informix sql syntax error has occurred. Error Code: -201 up vote 1 down vote favorite The only statement in my SQL code is DEFINE p_starttime DATETIME YEAR TO SECOND; I get this error from Informix 10.5: ERROR: A syntax error has occurred. Error Code: -201 Query = DEFINE p_starttime DATETIME YEAR TO SECOND Anybody has a clue why this might be happening? It's such a simple statement. informix sql error informix share|improve this question asked Jun 28 '12 at 18:50 Baris Seker 9818 You need to explain what you are trying to do. You can only define variables in the context of a stored procedure. You need to explain which language or program you are using to access the database. The CREATE FUNCTION statement might have failed for many different reasons. (Also, as a matter of interest, there never was a version 10.5 of Informix; the versions went 9.40, 10.00, 11.10, 11.50, 11.70. Which version of what are you using, on which platform?) –Jonathan Leffler Jun 29 '12 at 16:34 add a comment| 1 Answer 1 active oldest votes up vote 2 down vote It's not valid SQL, as simple as that. DEFINE is not a keyword you can use in a query. It is part of the Stored Procedure Language, or SPL syntax, ie: CREATE FUNCTION foo(); DEFINE p_starttime DATETIME YEAR TO SECOND; -- do stuff RETURN p_starttime; END FUNCTION; share|improve this answer answered Jun 28 '12 at 21:35 RET 7,84212027 This gives an error too: ERROR: A syntax error has occurred. Error Code: -201 Query = CREATE