AS SALAMO ALAIKUM WA RAHMATULLAH
create table TBL_PRODUCTS
(
ID bigint identity(1,1) primary key,
PRODUCTCODE VARCHAR(20),
PRODUCTNAME VARCHAR(200),
PRICE NUMERIC(18,3))
ALTER TABLE TBL_PRODUCTS ADD TRANSTIME TIME
ALTER TABLE TBL_PRODUCTS ADD TRANSTIMES bigint
ALTER PROC PROC_INSERT_PRODUCT
(
@PRODUCTCODE VARCHAR(10),
@PRODUCTNAME VARCHAR(300),
@PRICE NUMERIC(10,3)
)
AS
BEGIN
INSERT INTO TBL_PRODUCTS(PRODUCTCODE,PRODUCTNAME,PRICE,TRANSDATE,TRANSTIME,TRANSTIMES)
VALUES(@PRODUCTCODE,@PRODUCTNAME,@PRICE,GETDATE(),GETDATE(),((DATEPART(MINUTE,GETDATE())*60) + (DATEPart(HOUR,GetDATE())*3600) + DATEPart(SECOND,GetDATE())));
RETURN 1
END
note - CALCULATION OF TIME DONE HERE UNDER
select ((DATEPART(MINUTE,GETDATE())*60) + (DATEPart(HOUR,GetDATE())*3600) + DATEPart(SECOND,GetDATE()))
--
MA ASALAAM
PASSION 4 ORACLE
create table TBL_PRODUCTS
(
ID bigint identity(1,1) primary key,
PRODUCTCODE VARCHAR(20),
PRODUCTNAME VARCHAR(200),
PRICE NUMERIC(18,3))
ALTER TABLE TBL_PRODUCTS ADD TRANSTIME TIME
ALTER TABLE TBL_PRODUCTS ADD TRANSTIMES bigint
ALTER PROC PROC_INSERT_PRODUCT
(
@PRODUCTCODE VARCHAR(10),
@PRODUCTNAME VARCHAR(300),
@PRICE NUMERIC(10,3)
)
AS
BEGIN
INSERT INTO TBL_PRODUCTS(PRODUCTCODE,PRODUCTNAME,PRICE,TRANSDATE,TRANSTIME,TRANSTIMES)
VALUES(@PRODUCTCODE,@PRODUCTNAME,@PRICE,GETDATE(),GETDATE(),((DATEPART(MINUTE,GETDATE())*60) + (DATEPart(HOUR,GetDATE())*3600) + DATEPart(SECOND,GetDATE())));
RETURN 1
END
note - CALCULATION OF TIME DONE HERE UNDER
select ((DATEPART(MINUTE,GETDATE())*60) + (DATEPart(HOUR,GetDATE())*3600) + DATEPart(SECOND,GetDATE()))
--
MA ASALAAM
PASSION 4 ORACLE
No comments:
Post a Comment