Call SQL Server stored procedure using IBM Integration Bus ESQL - ibm-integration-bus

I am new to IIB, trying to call SQL server stored procedure using ESQL. Could anyone share working example to call stored procedure which returns single value.

There are 2 ways you can call a stored procedure in ESQL:
Define a procedure with the external keyword
https://www-01.ibm.com/support/knowledgecenter/SSMKHH_9.0.0/com.ibm.etools.mft.doc/ac17040_.htm
Or use the PASSTHRU statement and call the stored procedure by putting the SQL command to call it into the parameter of the statement
https://www-01.ibm.com/support/knowledgecenter/SSMKHH_9.0.0/com.ibm.etools.mft.doc/ak05100_.htm?lang=en

Related

Oracle Stored Procedure is not working in SSRS Query Designer

I wrote a stored procedure in Oracle 11g. It has 4 input parameters and 60 output parameters. It executes successfully and returns output using GUI in Oracle SQL developer tool.
But problem is in SSRS I connect with Oracle as ODP.NET Data Source. Test connection succeeds in shared data set properties.
When I select the specific stored procedure and pass 4 input parameters which are VARCHAR2 Data types
it shows an error:
You have to use the output parameters as well when you call the procedure.
PS: I don't like the idea of having 60 output parameters. I'd use a record or a collection (or both).

xPages calling a stored procedure

Is there a way to call a stored proc from xPages with parameters ?
I am using #JDBCExecuteQuery("oracle",sql,params)
How am I suppose to call the stored procedure ?
What would you put in your SQL line ?
AFAIK you cannot use a stored procedure with the #JDBC functions. Instead you can create a Java class/managed bean to call a stored procedure via JDBC. I have an example here how to use JDBC with the Extlib RDBMS features here: https://github.com/zeromancer1972/XPages-JDBC/blob/master/Code/Java/org/openntf/jdbc/DataConnector.java
The rules to issue a stored procedure are documented here: https://docs.oracle.com/javase/tutorial/jdbc/basics/storedprocedures.html

Parameter limit on Callable statement - Oracle jdbc driver (oracle.jdbc.OracleDriver)

I am using IBM message broker, v8.0.0.2. I am trying to call a stored procedure with 45 parameters, in and out. I use the Oracle jdbc driver (oracle.jdbc.OracleDriver). Turns out that I get an 'Invalid column index' SqlException, whenever I try to set the 45th IN or OUT parameter, which is weird. Is there such a limit?
Give Us the Code you've created and the Exception from the Exception list, by the way ,test the stored procedure using SQL Developer or any editor you are using then.. create procedure using ESQL and Call Database Stored Procedure.
CREATE PROCEDURE YourProcedureName(IN PARAM1 TYPE, IN PARAM2 TYPE,...,
OUT PARAM44 TYPE, INOUT PARAM45 TYPE)
LANGUAGE DATABASE DYNAMIC RESULT SETS 1 EXTERNAL NAME "ProcedureNameInDB";
In Main Function
CREATE FUNCTION Main() RETURNS BOOLEAN
BEGIN
--CopyMessageHeaders();
--CopyEntireMessage();
-- DECLARE HERE PARAMETERS FOR THE PROCEUDRE
-- In This Block Declare the 45 parameters for passing them in ESQL Procedure.
-- Then ESQL will pass them to Oracle Stored Procedure.
-- END DECLARE PARAMETERS FOR THE PROCEUDRE
-- Environment.DBRowSetResult: Storing Stored Procedure Output in Environment variable.
CALL YourProcedureName(param1, param2, .... param44,param45, Environment.DBRowSetResult);
END;

Executing stored Procedure on Oracle Database from SSIS

I have a SP which is Merge type in nature. For the purpose, I am laoding a temp table with data on Oracle database and Then I am inserting/Updating my destination table by calling this stored procedure. I am not passing any parameter inside this stored procedure.
When I used {call mystoredprocedure ()} using ado net or old db connection for oracle database, the execute sql task just goes yellow and never finishes up.
I have called this stored procedure directly on sql developer and it work fine.
Can anyone suggest me to do this correctly.
In Toad or SQL Developer, I would call my Oracle procedure with:
EXEC SCHEMA.MY_PROCEDURE();
In SSIS, in a SQL task, I can call my Oracle procedure like:
BEGIN SCHEMA.MY_PROCEDURE();
END;

How to do bulk insert using Stored Procedure In Spring DAO?

Stored Procedure is used to insert rows into Oracle Table. Using Spring DAO, in Data Access Layer. How to do batch insert using Stored Procedure call... Flexiable enough to change SP, if need...
There are a number of ways to do that:
You can change your stored procedure to have array params, then inside your stored procedure you iterate over the arrays and execute the inserts
You batch it on the Java side, and send them all in once. There are 3 ways to do that
Spring : BatchSQLUpdate
Spring : JDBCTemplate.batchUpdate
Java : PreparedStatement.addBatch
These are all to call an SQL statement in a batch, but you can call a stored procedure as well as an sql with the following syntax
:
?=call procedurename(?, ?, ?)

Resources