cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
Showing results for 
Search instead for 
Did you mean: 

Community Tip - When posting, your subject should be specific and summarize your question. Here are some additional tips on asking a great question. X

ExecuteDynamicSelect - Oracle

sgobi
6-Contributor

ExecuteDynamicSelect - Oracle

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


5 REPLIES 5
adam11
5-Regular Member
(To:sgobi)

Sabarish,

Can you provide the exact error message?

sgobi
6-Contributor
(To:sgobi)

[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

YangJaeUng
5-Regular Member
(To:sgobi)

where can I find "ExecuteDynamicSelect" service?


is it OOTB service or custom ?



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.

YangJaeUng
5-Regular Member
(To:paic)

Thank you very much Pai!


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


Greate~



Top Tags