last day (15 days later) » 

09:24
0
A: Update table columns based on the sample logic provided in Oracle

scaisEdgeAssuming your table tbl_fiber_inv_sign_off_sheet and your query result can be joined to the query result using the column SPAN_LINK_ID and the column RJ_LINK_ID You could try using an update based on subqery from your query result UPDATE tbl_fiber_inv_sign_off_sheet a SET UG_LENGTH = ( SEL...

hud
hud
hey scais, thanks for the fast reply with an answer. But do all the criteria mentioned above in question is checking.. i mean the percentage wise ?
@hud .. i assume that your query return a valid result and you problem is related to the way you can apply these result to the destination table .. i have asked before how the destination table and the source table are related .. so once you have a valid result you can apply this to the destination .. the where condition in the subquery .. is the key for join the the query to the destination table ... and you must apply a proper subquery for each column you want updatec.. hope this comment is useful ..
hud
hud
actually, I want to update UG_length and AR_length under Signoff section in the image..based on the calculation which I need to write..also, your update is proper but just the percentage calculation as described by me is needed
your comment is not clear to me (or your question is too complex for me) .. your image is an excel not a relational table .so .. the question seems the same to me ... "How query result and your destination table are related? which columns mantain a valid, exclusive link between the query result and the destination table ..?? once you know this you can apply to where condition for subquery ..
hud
hud
i guess i need to explain better to you as what is written in excel..can we come over chat for more explanation ?
09:24
yes .. if you think this is usefull ..
Hi
hud
hud
hello scais
can I start now
OK ..
hud
hud
See as u can see in the excel image
take first row for as an example
CMM App lengh is -> 23 ?
right
hud
hud
for say CMPP_Apprvoed for that SPAN_link_id is 23
for that same SPAN_link in NE.MV_SPAN@DB_LINK_NE_VIEWER is 25
ok ?
09:27
then your relation is based on a column span_link_id, ??
hud
hud
we need to add relation..till now it is not.
is my 25 of span is clear ?
.. i don't understan ..
in your excel che primary key is column CMM APpr LEn ?? ..
hud
hud
i am comparing.. SPAN_link_id of TBL_FIBER_INV_CMP_REPORT_MV to SPAN_link_id of NE.MV_SPAN@DB_LINK_NE_VIEWER
@scaisEdge no it is not primary key
to see difference in value i am comparing
ok ?
CMPP_Apprvoed is also in table TBL_FIBER_INV_CMP_REPORT_MV
then each row of TBL_FIBER_INV_CMP_REPORT_MV and each row od NE.MV_SPAN@DB_LINK_NE_VIEWER can be joined using the column SPAN_link_id ??
hud
hud
yes..
now u got it
but still my calculation is incomplete
can i move ahead
09:32
3rd Table ???
hud
hud
yes
but i want to update also
in 3rd table
based on the calucaltion which i will expalin
3rd Table .. ?? what mean ??
hud
hud
calculation of updation is still pending
i want to update based on getting values of UG and AR from NE.MV_SPAN@DB_LINK_NE_VIEWER for that SPAN_LINK_ID and update tbl_fiber_inv_sign_off_sheet tabl'es UG and AR column
u didnt let me explain fully
if u see my excel image
hud
hud
under NE.SPAN
there are NE_lenghth, UG and AR values
ok ?
09:35
ok
hud
hud
so comparing with the formulaes which I gave in snippet question i get PER UG and PER AR
as 92 and 8 respectivelty
got it?
see formulaes how i am dividing
in snippet
ok ?
UG_length ->(Percent_UG_len*CMM_APPR/100) and AR_length ->(CMM_APPR -UG_length) ???
hud
hud
YESSS
this is the main part mate
i want to bifurcate the values of UG and AR and update in my tbl_fiber_inv_sign_off_sheet table
now which u got it
hope u understood ?
you want update the column UG_LENGTH with Percent_UG_len*CMM_APPR/100 and the column AR_length with (CMM_APPR -UG_length .. for each corresponding SPAN_link_id ?? is right?
hud
hud
exactly
this is right
wherever SPAN_link_id matches
update it by the values of that row
for the formulaes which is mentioned
i guess u get it now
?
@scaisEdge : are u their mate ?
09:48
I do not understand and still do not understand .. I think my attempt is useless .. soon I will cancel my answer so someone else will be able to try to help you .. I hope for better results than mine.
hud
hud
hey
u are almost their mate
@scaisEdge this is what i want in query
please let me know as where u are stucked
i will expalin many times u want
I don't understand what is missing in the code of my answer (apart from the condition where with the name of the right fields) .. if your query return the valid result .. and you want update the destinatiion table with these results .. where is the problem .. ??
Or your query don't return a valid result ????
hud
hud
the problem is the bifurcation of UG and AR in ur query is missing
like in UG and AR it should be 21.16 and 1.84 in UG and AR respectively
under signoff section
that's the update I want
@scaisEdge my query was just sample to make question more presentable
as above ..I do not understand and still do not understand .. I think my attempt is useless .. soon I will cancel my answer so someone else will be able to try to help you .. I hope for better results than mine. ... .. we a wasting our time ..
hud
hud
See.. dont take my query as calculation
I want the update under signoff section to be updated
in my singoff sheet table
09:59
.. ok ..i take some time for think at your question .. if i have some better idea .. i comment you my update.. .. ..
hud
hud
ok
take a look more at the excel part
as how i am getting the values and dividing it
do ping me if u have any question
please help me out
hud
hud
10:14
hey @scaisEdge
hud
hud
for example
u can take this query
select * from tbl_fiber_inv_sign_off_sheet where SPAN_LINK_ID IN ('DLHI_0037');

select CALCULATED_LENGTH, RJ_SPAN_ID, RJ_LINK_ID FROM NE.MV_SPAN@DB_LINK_NE_VIEWER where RJ_LINK_ID ='DLHI_0037';
hud
hud
dont take that example
i will give one example
again
 
1 hour later…
hud
hud
11:19
@scaisEdge
can i explain now ?
if u r free
this is one example
select ROUTE_APPROVED_BY_CMM as CMM_APPROVED_LENGTH, SPAN_LINK_ID from TBL_FIBER_INV_CMP_REPORT_MV
where CMM_APPROVED_DATE IS NOT NULL
OR ROUTE_APPROVED_BY_CMM > 0
OR JOB_PROGRESS_FLAG = 1
and SPAN_LINK_ID='AMBD_9032';

select ROUND(SUM(NVL(CALCULATED_LENGTH,0)/1000),4) AS NE_LENGTH,
ROUND(SUM(CASE WHEN RJ_CONSTRUCTION_METHODOLOGY NOT LIKE '%AERIAL%' OR RJ_CONSTRUCTION_METHODOLOGY IS NULL THEN NVL(CALCULATED_LENGTH,0) ELSE 0 END)/1000,4) AS UG_LENGTH
,ROUND(SUM(CASE WHEN RJ_CONSTRUCTION_METHODOLOGY LIKE '%AERIAL%' THEN NVL(CALCULATED_LENGTH,0) ELSE 0 END)/1000,4) AS AR_LENGTH,
and also common
hud
hud
11:42
@scaisEdge: hey can u atleast solve this
select inv.ROUTE_APPROVED_BY_CMM as CMM_APPROVED_LENGTH, inv.SPAN_TYPE, ROUND(SUM(NVL(CALCULATED_LENGTH,0)/1000),4) AS NE_LENGTH,
ROUND(SUM(CASE WHEN RJ_CONSTRUCTION_METHODOLOGY NOT LIKE '%AERIAL%' OR RJ_CONSTRUCTION_METHODOLOGY IS NULL THEN NVL(CALCULATED_LENGTH,0) ELSE 0 END)/1000,4) AS UG_LENGTH
,ROUND(SUM(CASE WHEN RJ_CONSTRUCTION_METHODOLOGY LIKE '%AERIAL%' THEN NVL(CALCULATED_LENGTH,0) ELSE 0 END)/1000,4) AS AR_LENGTH,
ROUND(SUM(CASE WHEN RJ_CONSTRUCTION_METHODOLOGY NOT LIKE '%AERIAL%' OR RJ_CONSTRUCTION_METHODOLOGY IS NULL THEN NVL(CALCULATED_LENGTH,0) ELSE 0 END)/1000,4)/ ROUND(S
getting missing keyword error

last day (15 days later) »