'Robot Framework database Library - Execute SQL Script Keyword Issue
I'm doing some exercises using the Database Library on robot framework. My goal is to update the column WPA Results fr the row number 5 from a table called Parts as the picture below shows:
The update will be given by using the keyword Execute Sql Script from Database Library, please find below the code on robot framework
*** Settings ***
Library DatabaseLibrary
*** Test Cases ***
Example
Connect To Database pymssql TEST TestSQL 1q2w3e4r localhost 1433
${results} Execute Sql Script ${EXECDIR}${/}SQL1.sql
Log Many ${results}
The file SQL1.sql has:
UPDATE Parts
SET WPA RESULTS = '2020/08/05'
WHERE VIN = '547851'
GO;
When I run the code, I get the following error:
ProgrammingError: (102, "Incorrect syntax near 'RESULTS'.DB-Lib error message 20018, severity 15:\nGeneral SQL Server error: Check messages from the SQL Server\n")
How can I fix it? Thanks in advance
Solution 1:[1]
Surround WPA Results and VIN with backticks `
UPDATE Parts
SET `WPA RESULTS` = '2020/08/05'
WHERE `VIN` = '547851'
GO;
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|---|
| Solution 1 | Gander7 |

