OLEDB Query execution from data item
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
19-11-19 12:42 PM
Dynamically generating a query and placing it within the data item.
When trying to run the Data - OLEDB --> Get Collection and calling the data item, i get the below error message.
Could not execute code stage because exception thrown by code stage: Syntax error near '(end of line)' on line 1
But if i copy the query from the data item and place it within the Get Collection expression, it works perfectly.
------------------------------
Mario Fortunato
RPA Manager
FirstRand
Africa/Windhoek
------------------------------
When trying to run the Data - OLEDB --> Get Collection and calling the data item, i get the below error message.
Could not execute code stage because exception thrown by code stage: Syntax error near '(end of line)' on line 1
But if i copy the query from the data item and place it within the Get Collection expression, it works perfectly.
------------------------------
Mario Fortunato
RPA Manager
FirstRand
Africa/Windhoek
------------------------------
3 REPLIES 3
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
19-11-19 12:54 PM
Do you have extra quotations when it's in the data item? You may know this already, but I'll explain just in case.
If you put the Query into the SQL input of the Get Collection action, it has to have quotations around it like "SELECT * FROM tblTable", but if you put it in a data item it should not have the quotes around it but instead should be like SELECT * FROM tblTable.
------------------------------
Dave Morris
3Ci @ Southern Company
Atlanta, GA
------------------------------
Dave Morris, 3Ci at Southern Company
If you put the Query into the SQL input of the Get Collection action, it has to have quotations around it like "SELECT * FROM tblTable", but if you put it in a data item it should not have the quotes around it but instead should be like SELECT * FROM tblTable.
------------------------------
Dave Morris
3Ci @ Southern Company
Atlanta, GA
------------------------------
Dave Morris, 3Ci at Southern Company
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
19-11-19 01:01 PM
Hi Dave
I have tried all possible scenarios and yes you are correct.
When i have the query directly within the Get Collection i do have quotations around. But within the data item i'm not placing quotations, calling the data item [Final SQL Section 1] and getting the below error.
Could not execute code stage because exception thrown by code stage: Syntax error near '(end of line)' on line 1
------------------------------
Mario Fortunato
RPA Manager
FirstRand
Africa/Windhoek
------------------------------
I have tried all possible scenarios and yes you are correct.
When i have the query directly within the Get Collection i do have quotations around. But within the data item i'm not placing quotations, calling the data item [Final SQL Section 1] and getting the below error.
Could not execute code stage because exception thrown by code stage: Syntax error near '(end of line)' on line 1
------------------------------
Mario Fortunato
RPA Manager
FirstRand
Africa/Windhoek
------------------------------
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
19-11-19 01:24 PM
The only other thing I can think would involve character escaping. Any chance you could paste your SQL here, and I could try it as well.
------------------------------
Dave Morris
3Ci @ Southern Company
Atlanta, GA
------------------------------
Dave Morris, 3Ci at Southern Company
------------------------------
Dave Morris
3Ci @ Southern Company
Atlanta, GA
------------------------------
Dave Morris, 3Ci at Southern Company
