Tips for executing Oracle SQL statements in Flow Designer - Custom Action

RyanPSchneider
Tera Expert

Hello!

I am hoping someone can help review my Oracle SQL syntax to see if I am sending something in wrong or formatting it incorrectly as I can't seem to get a simple SELECT query to work.

 

I am able to connect successfully out to an Oracle DB and I would like to run a simple SELECT statement that checks to see if a row exists. From there, I will perform different catalog task creation from there.

 

The following SELECT statement that was provided to me works within the Oracle program installed but it doesn't seem to work when I try to test this out in the action.

 

SELECT * FROM DBA_USERS WHERE UPPER(USERNAME) IN('XXXXX'); -----XXXX is the identifier I am populating

In order to make this a bit more efficient, I got rid of the * and just did the username column so:

 

SELECT USERNAME FROM DBA_USERS WHERE UPPER(USERNAME) IN('XXXXX');

 

I then get the following error:

RyanPSchneider_0-1672931469001.png

 

When I try to shorten the query to try to pull rows in general - I get the following error:

RyanPSchneider_1-1672931576187.png

 

In any case, I am curious as to why I am struggling with simple SELECT syntax is not working. Any tips or ideas as to how I can get this to work? Thanks!

 

 

1 ACCEPTED SOLUTION

RyanPSchneider
Tera Expert

I was able to resolve the issue.

 

The custom action had an input where we would place the SQL statement in the input and place that into the SQL statement within the JDBC custom action. For some reason, that did not play nice. As soon as put the direct SQL statement in that field - it worked just fine. I hope that helps for others!

 

RyanPSchneider_0-1672949035623.png

 

View solution in original post

2 REPLIES 2

RyanPSchneider
Tera Expert

To confirm as well, I have tried to sanitize the SQL statement. I have an input to the action for the statement which is then parsed in the step. I've tried both functions to sanitize.

RyanPSchneider_0-1672931715937.png

 

RyanPSchneider
Tera Expert

I was able to resolve the issue.

 

The custom action had an input where we would place the SQL statement in the input and place that into the SQL statement within the JDBC custom action. For some reason, that did not play nice. As soon as put the direct SQL statement in that field - it worked just fine. I hope that helps for others!

 

RyanPSchneider_0-1672949035623.png