understanding of code

thota198
thota198 used Ask the Experts™
on
Can someone explain the meaning of this code in detail

 v_email_cd := TRIM (SUBSTR (i_email_cd, 1, INSTR (i_email_cd, i_locale) - 2));

SELECT b.resource_id, c.resource_id
                 INTO v_email_cd_res_id, v_email_subject_res_id
                 FROM (SELECT resource_id
                         FROM rbm_key
                        WHERE resource_code = (SELECT TRIM ('MESSAGE.BODY.' || SUBSTR (i_email_cd, 1, INSTR (i_email_cd, i_locale) - 2))
                                                 FROM DUAL)) b,
                      (SELECT resource_id
                         FROM rbm_key
                        WHERE resource_code = (SELECT TRIM ('MESSAGE.SUBJECT.' || SUBSTR (i_email_cd, 1, INSTR (i_email_cd, i_locale) - 2))
                                                 FROM DUAL)) c;
Comment
Watch Question

Do more with

Expert Office
EXPERT OFFICE® is a registered trademark of EXPERTS EXCHANGE®
Most Valuable Expert 2012
Distinguished Expert 2018
Commented:
Didn't we already explain the trim/substr code in a previous question?

If so, this is a duplicate question.

Using it in a where clause is just a simple string concat and equality check.

What is the question here?

Do more with

Expert Office
Submit tech questions to Ask the Experts™ at any time to receive solutions, advice, and new ideas from leading industry professionals.

Start 7-Day Free Trial