DynDeveloper.com

DynDeveloper.com

GuestLog Out
You are accessing the Members Only area for DynDeveloper.com using guest access. The member experience is slightly different
Leah 6/8/2018 12:05:37 PM

eConnect taItemSite Wrapper

* This article, and all our great .NET Development documentation, Is available on the .NET Development menu

This stored procedure wraps the eConnect taItemSite stored procedure, making it easier to call. 

It also returns the full error text in case of an error, and not just the cryptic error ID

Version: All
Section: SQL Scripts
IF EXISTS (SELECT name
       FROM   sysobjects
       WHERE  name = N'dd_taItemSiteWrapper'
       AND    type = 'P')
    DROP PROCEDURE dd_taItemSiteWrapper
GO
 
CREATE PROCEDURE dd_taItemSiteWrapper
 
-- dd_taItemSiteWrapper 'mortarcovers~~','020',0
 
@ITEMNMBR varchar(30),
@LOCNCODE varchar(10),
@UpdateIfExists int
 
AS
 
set transaction isolation level read uncommitted
DECLARE @O_iErrorState INT,
    @oErrString VARCHAR(256),
    @ErrorDesc VARCHAR(256)
 
SELECT @O_iErrorState = 0
 
EXEC taItemSite
    @I_vITEMNMBR = @ITEMNMBR,
    @I_vLOCNCODE = @LOCNCODE,
    @I_vUpdateIfExists = @UpdateIfExists,
    @O_iErrorState = @O_iErrorState OUT,
    @oErrString = @oErrString OUT
 
IF @O_iErrorState > 0 BEGIN
    SELECT @ErrorDesc = tec.ErrorDesc
        FROM dynamics..taErrorCode tec
        WHERE tec.ErrorCode = @O_iErrorState
END ELSE BEGIN
    SELECT @ErrorDesc = ''
end
 
 
SELECT @O_iErrorState AS ErrorState, @oErrString AS ErrString, @ErrorDesc AS ErrorDesc
 
 
 
GO
 
grant exec on dd_taItemSiteWrapper to public
--  sp_sps 't'

Add a Comment



Not Subscribed. You will not receive emails on article changes or comment additions

Comments

body header
No records to display.