DB SQL Executor Error

Hi @ScottF @sjporter @PhilippSimon_KNIME I have a ‘PayDate’ column added to my string manipulation query that executed perfectly. But when I Try to use the DB SQL Executor to run a placeholder statement I keep getting this error, 3:13 Execute failed: Invalid column name ‘PayDate’.

Where could the error be from please?

Thanks.

Hi @Uchechukwu1 -

I made a separate topic for your question, since it was at the bottom of an older thread. Also, let’s avoid tagging a bunch of people in your questions, as it generates a lot of notifications.

Now to address the issue: I don’t think we have enough information (or at least I don’t). Can you post the content of the DB SQL Executor node? What is the “string manipulation query that executed perfectly” - something upstream? What does the structure of your table look like prior to the SQL statement you’re trying to run?

Details and screenshots help us help you. :slight_smile:

2 Likes

Thanks @ScottF Pay Date column exists on the database, however I renamed it earlier to PayDate and followed with a string manipulation using this query; Select [Columns] WHERE [PayDate] >= cast(‘", $${SMin(Pay Date)}$$, "’ as date)") and this query executed.

But when I connect to > Microsoft SQL Server Connector (executed) > DB SQL Executor ‘placeholder’ query on my SQL statement, it brings the 3:13 Execute failed: Invalid column name ‘PayDate’.

Thanks

@Uchechukwu1 I do not think we have enough information and also the syntax you post might better be included in blockqoute or pre-formatted text to show us the exact version.

Also some SQL servers are quite picky when it comes to masking words and using quotation marks.

it might very well be that „date“ is a reserved word and has to be enclosed in brackets or something.

https://support.microsoft.com/en-us/office/sql-reserved-words-b899948b-0e1c-4b56-9622-a03f8f07cfc8

3 Likes

Hi @mlauber71 I played around using the original column with space not the renamed column without space and the node executed. Now, when I connect to dbwriter node to append columns, it starts to execute but fails at 0%

Hi @Uchechukwu1 , you are still not providing enough information unfortunately as both @ScottF and @mlauber71 mentioned, and the additional info we got from your last post is not telling us much. All we know is that you “played around”, and that it “fails at 0%” without giving much about how it failed.

A message of “3:13 Execute failed: Invalid column name ‘PayDate’” is pretty clear. There is no column with name “PayDate”.

Can you provide these following information?

  1. What are you running in your DB SQL Executor? And please use the pre-formatted format that @mlauber71 instructed to when pasting the query
  2. What error message do you get for the query you are showed in question #1 above?
2 Likes