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

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??


  • Options

    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

    Hope this helps.

  • Options
    Thanks a lot Pravesh!!
    I have implemented what you have suggested!!

Leave a Comment

BoldItalicStrikethroughOrdered listUnordered list
Align leftAlign centerAlign rightToggle HTML viewToggle full pageToggle lights
Drop image/file