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

ThingWorx Navigate is now Windchill Navigate Learn More

Translate the entire conversation x

ExecuteDynamicSelect - Oracle

sgobi
7-Bedrock

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
7-Bedrock
(To:sgobi)

Sabarish,

Can you provide the exact error message?

sgobi
7-Bedrock
(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

where can I find "ExecuteDynamicSelect" service?


is it OOTB service or custom ?



paic
12-Amethyst
(To:YangJaeUng)

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
10-Marble
(To:paic)

Thank you very much Pai!


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


Greate~



Announcements


Top Tags