Execute SQL Statement on Oracle DB Server(JDBC ACTIVITY)

Sravani36
Tera Expert

Hi i have configured test jdbc connections to execute the sql statement on the oracle db server and to capture the output 

1) In the jdbc connection for the fields *Host:- given the IP of the db server and credentials are validated.

2)coming to custom jdbc activity from the workflow the below sql statement should execute on the input (Ip of the different db servers) we give. But it's executing on the Host name we give on point 1 in credentials

find_real_file.png

find_real_file.png

 

So my requirement is it should execute on the whatever input (IP OF ORACLE DB SERVER) we give for the activityinput.input1.

How to fix this or any other suggestions please share.

find_real_file.png

Thanks in advance

Sravani C

6 REPLIES 6

H_9
Giga Guru

Hi Sravani,

I would recommend you to go with the OOTB JDBC activity in the flow design, instead of going with a custom JDBC activity in the workflow.

The configuration in the flow design is much easier and time saving.

Note: you will need integration hub plugin active for this.

Please mark the answer correct if this helps. šŸ™‚

Thanks.

Thanks. šŸ™‚

Rahul Priyadars
Giga Sage
Giga Sage

Hi Sravani

May i know the Problem Statement Not in terms of Service Now , In terms of what the end goal you want to do?

What i understood briefly is - You have 1 Fixed SQL and you have n of Oracle DBs running on host1..host2 ...Hostn. You need to execute the same SQL on all oracle DB servers?

Regards

RP

Hi Rahul,

I want to Execute this  sql statement(SELECT * FROM sys.DBA_USERS ORDER BY USERNAME)  on each oracle db server, however this custom workflow is attached to the catalog item and get the output to the worknotes of the requested item(as below) .

find_real_file.png

In the catalog item we have a field called IP Address where the oracle db server ip is populated on change of servers. we want to take this IP From the catalog variable as a input and execute sql statement on the server selected.

find_real_file.png

and as you said I need to execute same SQL on all DB servers, this is what i require a solution for as i have n number of oracle DBs. 

Thanks and Regards 

Sravani C

Let me think but Its not going to work Using JDBC when Oracle HostName/IP will vary.

In my view on Mid server you keep an Oracle SQL Client.

send your Inpute parameters for DB connection to Mid server ..

Make a Silent session using parameter on mid using Oracle sqlclient

Store output locally in file  on mid server

Read output and update in work-notes.

Regards

RP