Tutorials

  1. Home
  2. Dokumente
  3. Tutorials
  4. 85. How to call store procedure by handling the response using Agent?

85. How to call store procedure by handling the response using Agent?

Introduction

This tutorial explains how to use the new feature calling store procedure by handling the response using Agent. the responding store procedure is calling out from Salesforce to database system vai store procedure. After callout and we will get a response or fault message back real-time in the same calling. It supports only Synchronous mode.

How to call store procedure by handling the response using Agent

Pre-request call store procedure by handling the response 

firstly, you need to have some required step before you can do call store procedure by handling the response:

  1. Create a Store Procedure
  2. Create Interface (Inbound as a response and outbound as a request interface)
  3. Create Adapter
  4. Do mapping (Inbound and Outbound)

Configuration

  1. Create a Store Procedure

Stored Procedure template:


CREATE PROCEDURE [dbo].[upsertAccountTest01](

@id nvarchar (255),

@name nvarchar (255),

@billingcity nvarchar (255),

@billingcountry nvarchar (255),

@nameOut nvarchar (255) OUTPUT,

@billingcityOut nvarchar (255) OUTPUT,

@billingcountryOut nvarchar (255) OUTPUT

)

AS BEGIN

IF EXISTS(SELECT id, name, billingcity, billingcountry FROM Account_Out WHERE Name=@name)

BEGIN

UPDATE Account_Out

SET id=@id, name=@name, BillingCity=@billingcity, BillingCountry=@billingcountry

WHERE Name=@name;

END

ELSE BEGIN

INSERT INTO Account_Out (Id, Name, BillingCity, BillingCountry)

VALUES (@id, @name, @billingcity, @billingcountry);

END

SELECT @id=id, @nameOut=name, @billingcityOut=billingcity, @billingcountryOut=billingcountry FROM

Account_Out WHERE name=@name;

END

2. Create an interface

  • Select Operation Type: UpSert
  • Select processing mode: Synchronous
  • The inbound interface as a Response interface
  • An outbound interface as a Request interface

3. Create Adapter on Agent UI

  • Please run SKYVVA Integration Agent -> Integration Wizard
  • Choose your Property File
  • Go to interface detail by double click any interface in the interface list
  • Creating of JDBC Adapter

4. Do mapping

  • Outbound interface

  • On Outbound interface you need to add the ID of Inbound interface on-field Response interface

  • The inbound interface you need to create Istructure (@nameOut,@billingcityOut,@billingcountryOut) like parameter in Store Procedure

  • Do mapping on Inbound interface

5. Push data

6. Check the result on Message board

Fandest du diesen Artikel hilfreich? Ja Nein

Wie können wir helfen?