Skip to main content
1-Visitor
October 28, 2014
Question

ExecuteDynamicSelect - Oracle

  • October 28, 2014
  • 3 replies
  • 1349 views

Hi
I am trying to run below against Oracle database.
var sql_query = "select sysdate from dual";

// ExecuteDynamicSelect(Query:STRING):INFOTABLE
var result = me.ExecuteDynamicSelect({
        Query : sql_query
    });

It gives me Invalid SQL error.
I am able to run SQL Queries and Commands.

Appreciate your help!
Thanks


    3 replies

    5-Regular Member
    October 28, 2014

    Sabarish,

    Can you provide the exact error message?

    sgobi1-VisitorAuthor
    1-Visitor
    October 28, 2014

    [context: com.thingworx.webservices.context.HttpExecutionContext@53dafe31][message: Execution error in service script [PAPPSDB_JAL FetchDDRs] : Wrapped java.sql.SQLSyntaxErrorException: ORA-00900: invalid SQL statement

    5-Regular Member
    June 11, 2015

    where can I find "ExecuteDynamicSelect" service?


    is it OOTB service or custom ?



    1-Visitor
    June 11, 2015

    that is a custom service Sabarish defined.

    He is constructed an SQL string and passing it into a service that executes it.
    This requires the << >> style substitution, which comes with the risk of SQL injection and must be used prudently and always in a secure way.

    5-Regular Member
    June 11, 2015

    Thank you very much Pai!


    I understand it now. Well it's very useful for Dynamic Query.


    Greate~