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:

enter image description here

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

Upvotes: 0

Views: 3648

Answers (1)

Moad Charaf
Moad Charaf

Reputation: 1

Surround WPA Results and VIN with backticks `

UPDATE Parts
SET `WPA RESULTS` = '2020/08/05'
WHERE `VIN` = '547851'
GO;

Upvotes: 0

Related Questions