Follow

SQL-0004: Syntax Error While Attempting to Use SQL to Specify Default Column Values

Overview:

There may be a time where we would to specify a default value for a column that may not have data directly inserted during ingest. The purpose of this article is to publish that fact that specifying default column values via SQL in other databases may be supported, in Kinetica is not a supported feature. The process will fail with error. 

 

Error:

EXECUTING...
SQL: create or replace table task_progress ( id smallint not null, assignee_name varchar(128) not null, date_added timestamp not null, completion varchar(1) not null default 'i', primary key (id), )
==============================================================
Connection successful
Catalog [Kinetica]
Deployment Time: 0.364 s
Error: 'Job process error, what: 'SqlEngine: Encountered "default" at line 1, column 162.
(S/SDc:711); code:1 'Error'''
EXECUTION FINISHED

 

Example Use Case:

Creation of a progress table with a completion column to identify if a task is complete "c" or incomplete "i". We would like the default value to be "i" for this column until manually updated. Attempting to use the following SQL will fail:

create or replace table task_progress (
id smallint not null,
assignee_name varchar(128) not null,
date_added timestamp not null,
completion varchar(1) not null default 'i',
primary key (id),
);

 

Conclusion:

Specifying default values for columns is not a supported function in Kinetica.

 

Should you have any questions or concerns, please visit our Official Documentation and Support Page.

Was this article helpful?
0 out of 0 found this helpful
Have more questions? Submit a request

0 Comments

Please sign in to leave a comment.