cancel
Showing results for 
Search instead for 
Did you mean: 

JDBC RECEIVER -- conditional stored procedure

Former Member
0 Kudos

Hi All,

I have a situation where I need to call one stored procedure which returns to me if for a particular employee a record exists or not depending on that result I need to call further stored procedure. Can it be handled in one interface call. My scenario is :

1. Source system checks xxx database server to see if employee exists.

Call GetEmplExsts stored procedure from xxx.

2. Call the appropriate stored procedure from xxx depending on the status of the

employee (if they already exist in xxx or not).

Call CreatEmp stored proc if the employee does NOT already exist in xxx

OR

Call UpdatEmp stored proc if the employee already exists in xxx.

Thx in advance

Ravijeet

Accepted Solutions (1)

Accepted Solutions (1)

rodrigoalejandro_pertierr
Active Contributor
0 Kudos

hi

i recommend you that create a sp with 3 condicions so you only do one call and is more easy to applicate in pi.

for ex

@@Exist char(2)

exist = select existEmp from EMPLOYEE

IF exist = "X" {

execute updateEmp

}

else{

execute createEmp

}

i dont remember too much how to define it in SQL 😛

Edited by: Rodrigo Pertierra on Feb 26, 2008 1:12 PM

Answers (1)

Answers (1)

justin_santhanam
Active Contributor
0 Kudos

Ravi,

If you handle everything in your single Store Proc which XI is gng to call then you can do in one Interface call.

raj.