How to populate a field using table component?? (178 Views)
Reply
Frequent Advisor
RRK_19
Posts: 63
Registered: ‎02-22-2012
Message 1 of 2 (178 Views)

How to populate a field using table component??

Hi,

 

I have a field "Budget" which is having a validation query as follows:

SELECT tbl.parameter1||' - '||tbl.parameter2||' - '||tbl.parameter3, tbl.parameter1||' - '||tbl.parameter2||' - '||tbl.parameter3

FROM    KCRT_TABLE_ENTRIES_V tbl        

INNER JOIN KCRT_REQUESTS_V req on (req.REQUEST_ID = tbl.REQUEST_ID  

     and req.REQUEST_TYPE_NAME = 'X_RT_Process_Parameter'     and req.BATCH_NUMBER = 1)  

INNER JOIN KNTA_PARAMETER_SET_FIELDS psf on (psf.parameter_set_field_id=tbl.parameter_set_field_id                     and psf.parameter_token='X_RTF_BDG_CD_LIST')

ORDER BY tbl.seq;

 

When this field gets populated, i want to automatically populate another field (based on the selected value) I used the below query to achieve the same, but it is not working.

SELECT tbl.parameter6

from KCRT_TABLE_ENTRIES_V tbl  

INNER JOIN KCRT_REQUESTS_V req on (req.REQUEST_ID = tbl.REQUEST_ID   and req.REQUEST_TYPE_NAME = 'X_RT_Process_Parameter'   and req.BATCH_NUMBER = 1)

  INNER JOIN KNTA_PARAMETER_SET_FIELDS psf on (psf.parameter_set_field_id=tbl.parameter_set_field_id                       and psf.parameter_token='X_RTF_BDG_CD_LIST')

  where tbl.parameter3 in (SELECT SUBSTR('[REQD.P.X_RTF_BDG]',   (INSTR('[REQD.P.X_RTF_BDG]','-',1,2)+1),length('[REQD.P.X_RTF_BDG]')) FROM dual)  

and tbl.parameter1 in (SELECT (SUBSTR('[REQD.P.X_RTF_BDG]',1,(INSTR('[REQD.P.X_RTF_BDG]',' -',1,1))) )from DUAL)  ;

 

Can you please provide some suggestion how this can be done?

 

Thanks!!

Honored Contributor
Utkarsh_Mishra
Posts: 713
Registered: ‎07-13-2010
Message 2 of 2 (151 Views)

Re: How to populate a field using table component??

In your Rule, check whether your query (2nd one) is returning correct result. To validate just append any character at the end of your SQL, so that it fails to execute and then go to server.log to get the SQL. 

 

This SQL will have the resovled TOKEN values, run this SQL in any oracle tool and check whether it is working as expected.

 

 

Cheers..
Utkarsh Mishra

-- Remember to give Kudos to answers! (click the KUDOS star)
The opinions expressed above are the personal opinions of the authors, not of HP. By using this site, you accept the Terms of Use and Rules of Participation.