Description
Properties
| Name | Value |
|---|---|
| ANSI Nulls ON | True |
| Quoted Identifier ON | True |
| Encrypted | False |
| Execute As | |
| Assembly |
Parameters
| Name | Data Type | Length | Description |
|---|---|---|---|
| @idbc27hdr | bigint | 8 | |
| @userid | varchar | 10 | |
| @nobc27 | varchar | 20 | |
| @tglbc27 | date | 3 | |
| @nilkurs | float | 8 |
SQL Script
SET QUOTED_IDENTIFIER, ANSI_NULLS ON
GO
CREATE PROCEDURE dbo.sp_insertmodulbc27
(@idbc27hdr as bigint,@userid varchar(10), @nobc27 varchar(20), @tglbc27 date, @nilkurs float)
AS
BEGIN
-- declare @countdata int
-- declare @detilitemcount int
-- set @countdata = (select COUNT(*) as cnt from dbo.tbl_bc_out_hdr where id_bc_out_hdr = @idbc27hdr and statusdok = 'DATA PROCESSED')
-- IF @countdata <> 1
-- BEGIN
--select '01' as status, ' DATA Not Found or Already Exist' as hasil
--return
-- END
declare @now datetime
set @now = GETDATE()
UPDATE tbl_bc_out_hdr set NODAFT=@nobc27, TGDAFT=@tglbc27, NILKURS=round(@nilkurs, 2)
,update_date=@now,
update_by=@userid
where id_bc_out_hdr = @idbc27hdr
-- INSERT INTO tbl_bc_out_hdr_h_status
-- (id_bc_out_hdr, statusdok, status_date
-- ,[create_by]
-- ,[create_date]
-- ,[update_by]
-- ,[update_date])
-- VALUES (@idbc27hdr, (select top 1 statusdok from tbl_bc_out_hdr where id_bc_out_hdr = @idbc27hdr), @now
--,@userid
--,@now
--,@userid
--,@now
--)
select '00' as status, ' Sukses'+' :Data Updated' as description
END
GO
GO
CREATE PROCEDURE dbo.sp_insertmodulbc27
(@idbc27hdr as bigint,@userid varchar(10), @nobc27 varchar(20), @tglbc27 date, @nilkurs float)
AS
BEGIN
-- declare @countdata int
-- declare @detilitemcount int
-- set @countdata = (select COUNT(*) as cnt from dbo.tbl_bc_out_hdr where id_bc_out_hdr = @idbc27hdr and statusdok = 'DATA PROCESSED')
-- IF @countdata <> 1
-- BEGIN
--select '01' as status, ' DATA Not Found or Already Exist' as hasil
--return
-- END
declare @now datetime
set @now = GETDATE()
UPDATE tbl_bc_out_hdr set NODAFT=@nobc27, TGDAFT=@tglbc27, NILKURS=round(@nilkurs, 2)
,update_date=@now,
update_by=@userid
where id_bc_out_hdr = @idbc27hdr
-- INSERT INTO tbl_bc_out_hdr_h_status
-- (id_bc_out_hdr, statusdok, status_date
-- ,[create_by]
-- ,[create_date]
-- ,[update_by]
-- ,[update_date])
-- VALUES (@idbc27hdr, (select top 1 statusdok from tbl_bc_out_hdr where id_bc_out_hdr = @idbc27hdr), @now
--,@userid
--,@now
--,@userid
--,@now
--)
select '00' as status, ' Sukses'+' :Data Updated' as description
END
GO
Depends On
1Used By
No items found