You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 

34 lines
1.1 KiB

ALTER proc proc_customerInfo
@flag VARCHAR(30) ,
@customerId VARCHAR(20) = NULL,
@user VARCHAR(20) = NULL
AS
SET NOCOUNT ON;
SET XACT_ABORT ON;
BEGIN
IF @flag = 'getCustomerAndReceiverInfo'
BEGIN
DECLARE @customerIdNew BIGINT, @rowId BIGINT
select @customerIdNew = CUSTOMERID FROM CUSTOMERMASTER WHERE MEMBERSHIPID =@customerId
IF len(@customerId) > 7
BEGIN
select @customerIdNew = CUSTOMERID FROM CUSTOMERMASTER WHERE MEMBERSHIPID =@customerId
END
ELSE
BEGIN
SELECT @customerIdNew = CUSTOMERID FROM customerMaster WHERE postalCode = @CUSTOMERID
END
IF cast(@customerIdNew as varchar) IS NULL
BEGIN
SELECT '1' Error_Code,'Customer Doesnot Exists' Msg,@CUSTOMERID id
RETURN
END
SELECT fullname,membershipId FROM customerMaster WHERE CUSTOMERID = @customerIdNew
SELECT isnull(firstname,'') + isnull(' '+middleName,'') + isnull(' ' + lastname1,'') [fullname],
isnull(address,''),
isnull(mobile,''),
isnull(idType,''),isnull(idnumber,'')
FROM receiverInformation WHERE customerId = @customerIdNew
END
END