DB SQL Executor Comments

Is there a right way to include comments in DB SQL Executor? It seems to recognize both simple and bracketed comments, but I am having to remove them as I add more lines of code to it to get it to not err out.

The error message being returned is:
Execute failed: Invalid SQL type: sqlKind = UNINITIALIZED

Hi @kevinnay , I’m not sure what you mean by “simple and bracketed comments”, but typically you can include the standard sql comments in the DB SQL Executor

-- single line comment
/* multi
line comment */


-- this is a comment
create table if not exists myschema.mytable(mycolumn varchar(20));
/* this is 
another comment */
create table if not exists myschema.mytable2(mycolumn varchar(20));

If they don’t work, what database are you using?

edit: I’ve done some googling for the error you mentioned. This error appears to be sometimes related to spaces (or maybe lack of them) in your sql. (Not specifically KNIME related, but potentially an issue with some jdbc drivers/databases)

For example, I found one mentioned that including a comment such as


caused it to error, but by changing this to


(i.e. adding a space after the “--” it then worked. Maybe that is what you are experiencing?

1 Like