Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi,
I'm using MS SQL DB and wanted to load data from a DB view.
LOAD [Ref No],
Comment,
Function;
[vwTable]:
SELECT "Ref No",
Comment,
Function
FROM vwTable;
It gave an error as below:
Started loading data
The following error occurred:
Connector reply error: SQL##f - SqlState: 42000, ErrorCode: 156, ErrorMsg: Incorrect syntax near the keyword 'Function'.,
The error occurred here:
?
Data has not been loaded. Please correct the error and try loading again.
If I remove the "Function" column from query, it is able to load successfully. The "Function" column contains alphabet characters and some Null values.
What could be the cause?
Thank you.
The error shows "function" is a keyword:
Incorrect syntax near the keyword 'Function'.
You need to add "" so that system knows that it is a column, not a keyword in the system.
What is this "vwTable"?
[vwTable]:
LOAD [Ref No],
Comment,
Function;
SELECT "Ref No",
Comment,
Function
FROM vwTable;
try as per above
"vwTable" is a DB view which I'm loading the data from. Same error when I put [vwTable]: at the top of the script.
I'm not modifying the data from the DB view, just connecting to DB, selecting all columns and loading them to Qlik using the standard Data load editor.
try like this
[vwTable]:
LOAD [Ref No],
Comment,
Function;
SQL SELECT "Ref No",
Comment,
Function
FROM vwTable;
Yes also tried putting [vwTable] at the top of the script but same error.
try to rename column name "Function" in your view to something else and than try.
Is the "Function" column name causing any conflict in Qlik?
When I query the same 3 columns ("Ref No", Comment & Function) directly on SQL DB level, I'm able to see the output so not sure why Qlik is complaining about the error.
Is that simple SQL query working firstly?
SQL SELECT "Ref No",
Comment,
Function
FROM vwTable;
If so, Try to use something like this?
Load *;
SQL SELECT "Ref No",
Comment,
Function
FROM vwTable;
The SQL query is working fine when I run it in DB level. Tried below but same error:
[vwTable]:
Load *;
SQL SELECT "Ref No",
Comment,
Function
FROM vwTable;
Maybe try:
LOAD [Ref No],
Comment,
[Function];
[vwTable]:
SELECT "Ref No",
Comment,
"Function"
FROM vwTable;