Skip to main content

SQL Error [4856]:[Vertica][VJDBC](4856) ERROR: Syntax error at or near "#"

  • March 3, 2014
  • 2 replies
  • 20 views

Merlin_Arockias
I am trying to make an exact DDL copy of a table from Oracle to Vertica. In Oracle schema I have a table  with the following DDL
create table TEST
(
id int,
name# varchar2(100),
city varchar2(100));

The Equivalent Vertica DDL is
create table TEST
(
id int,
name# varchar(100),
city varchar(100));

But when i create the table in Vertica, I get the following error message.
Error:SQL Error [4856] [HY000]: [Vertica][VJDBC](4856) ERROR: Syntax error at or near "#"
I do not see in SQLRefManual anything about column name constraints.
I cannot make changes to Column name as there will be conflict in mapping in ETL.
What can be the solution??

2 replies

Forum|alt.badge.img+2
  • Participating Frequently
  • March 5, 2014
Hi,

You can enclose column name in quotes (""). Quoted identifiers can contain any characters, including one which are not allowed/valid otherwise (in this case #).

Following should work:

create table TEST
(
id int,
"name#" varchar(100),
city varchar(100));

You can read more about it in Vertica Doc:

SQL Reference Manual --> SQL Language Elements --> Identifiers
(https://my.vertica.com/docs/6.1.x/HTML/index.htm#8944.htm).

Hope this helps.

Thanks.
Pravesh

Merlin_Arockias
  • Author
  • Participating Frequently
  • March 6, 2014
Thanks a lot Pravesh!!
I have implemented what you have suggested!!