Open Source RDBMS - Seamless, Scalable, Stable and Free

한국어 | Login |Register

How to Quote Reserved Keywords


One important fact that you should know about any database management system is how to quote reserved keywords when you want to use them as column names or even table names.

If you want to know which are the Reserved Keywords, they are all listed in our manual page: Reserved Keywords

In CUBRID, you can use Reserved Keywords as table names or column names using one of the following 3 approaches:

  • Backtick Symbol - `
  • Double Quotes - "
  • Square Brackets - [

Let's assume you want to use a column name entitled VALUE. Acceptable table definitions are:

CREATE TABLE tst1 ([value] INT);
CREATE TABLE tst2 (`value` INT);
CREATE TABLE tst3 ("value" INT);

If you put value without using one of the escaping methods, then you will encounter the error "Syntax: syntax error, unexpected VALUE":

reserved_keyword_error.png

comments powered by Disqus
Page info
viewed 2081 times
translations en
Author
posted 2 years ago by
CUBRID
Contributors
updated 2 years ago by
View revisions
Share this article