Application Integration

Expand all | Collapse all

OLEDB Query execution from data item

  • 1.  OLEDB Query execution from data item

    Posted 11-19-2019 12:42
    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
    ------------------------------


  • 2.  RE: OLEDB Query execution from data item

    Posted 11-19-2019 12:54
    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
    ------------------------------



  • 3.  RE: OLEDB Query execution from data item

    Posted 11-19-2019 13:01
    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
    ------------------------------



  • 4.  RE: OLEDB Query execution from data item

    Posted 11-19-2019 13:24
    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
    ------------------------------