0
votes

I have a procedure where the same SAP_ID is inserted thrice. But their BILL_START_DATE and BILL_END_DATE is different for all the sap id.

Below is the updated information

IMG

So I want to calculate for each sap id with respect to different start and end date. So is there any way on how to make it differentiate for calculation purpose.

Below is table details

Table: IPFEE_MST_INSRT_BIL

Name                          Null? Type           
----------------------------- ----- -------------- 
SAP_ID                              NVARCHAR2(100) 
R4GSTATE                            VARCHAR2(100) 
BILL_START_DATE                     DATE           
BILL_END_DATE                       DATE           
UPLOADED_MONTH                      VARCHAR2(9)    
UPLOADED_YEAR                       VARCHAR2(9)  

Also where I want to calculate is the procedure link below

Procedure link

Sorry, but - what are we supposed to do with 1000 lines of code (you posted on db<>fiddle)? Can't you simplify it? What does table (you posted here) have to do with that code? There are 3 references to it - one is DELETE from that table, another is commented (so is irrelevant) and the third is INSERT INTO the table. Which one of these represents "I want to calculate for each sap id with respect to different start and end date. So is there any way on how to make it differentiate for calculation purpose"? - Littlefoot
@Littlefoot: I can explain you: for ex, I want to calcualte for 1st sapid whose date start and end is 1may and 6may respectively. So i want to take the date for that sap id and assign it for calculation. how can I achieve it ? - Nad
Which calculation? Maybe you'd want to select BILL_START_DATE and BILL_END_DATE into local variables and use them elsewhere? Or do it in a loop (as you have 3 rows for the same SAP_ID)? - Littlefoot
yes, I want to use in my SP. for each row there is different start date and end date. so for ex: if one row start date is 1 may and end date is 6 may. so calcualtion I have to make is for 6 days. like that I want to make for all the multiple sap ids - Nad
@Littlefoot: any update, pls suggest - Nad