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.

48 lines
2.1 KiB

1 year ago
  1. USE [FastMoneyPro_Remit]
  2. GO
  3. /****** Object: StoredProcedure [dbo].[proc_importLocation] Script Date: 9/27/2019 1:30:14 PM ******/
  4. SET ANSI_NULLS ON
  5. GO
  6. SET QUOTED_IDENTIFIER ON
  7. GO
  8. /*
  9. EXEC proc_importLocation
  10. */
  11. CREATE proc [dbo].[proc_importLocation]
  12. AS
  13. SET NOCOUNT ON
  14. DECLARE @SPWithParams NVARCHAR(MAX)
  15. SET @SPWithParams =
  16. '
  17. Exec ime_plus_01.dbo.spa_SOAP_Domestic_DistrictList '
  18. + '''''' + 'kathmandu' + '''''' + ','
  19. + '''''' + 'kathmandu' + '''''' + ','
  20. + '''''' + 'kathmandu' + '''''' + ','
  21. + '''''' + '1234' + '''''' + ','
  22. + '''''' + 'c' + ''''''
  23. PRINT(@SPWithParams)
  24. EXEC ProcToTable @SPWithParams, '##res'
  25. IF((SELECT TOP 1 code FROM ##res) <> 0)
  26. BEGIN
  27. EXEC proc_errorHandler 1, 'Technical Error in importing data', NULL
  28. DROP TABLE ##res
  29. RETURN
  30. END
  31. DELETE FROM api_districtList WHERE fromAPI = 'Y'
  32. INSERT INTO api_districtList(code, districtCode, districtName, fromAPI)
  33. SELECT code, district_code, UPPER(district_name), 'Y' FROM ##res
  34. EXEC proc_errorHandler 0, 'Import Successful', NULL
  35. DROP TABLE ##res
  36. GO