Monday, October 25, 2010

Remove tags from comment field

Use REGEXP_REPLACE(X.COMMENTS,'<[^<>]*>','') to remove tags like below:

SELECT
A.HRS_JOB_OPENING_ID,
A.CLOSE_DT,
A.STATUS_REASON,
,X.COMMENTS
,REGEXP_REPLACE(X.COMMENTS,'<[^<>]*>','')
FROM PS_HRS_JOB_OPENING A, PS_HRS_OPNAPR_XREF X
WHERE A.HRS_JOB_OPENING_ID = X.HRS_JOB_OPENING_ID
AND A.STATUS_REASON <> ''

In addition, you could explore these two functions:
1) htf.escape_sc(x.comments)
2) dbms_xmlgen.convert(x.comments)

Wednesday, July 14, 2010

Make Page View Only

GetPage(Page.MY_PAGE1).DisplayOnly = True;

Verify / match role or permission list.

IsUserInRole(rolename1 [, rolename2]. . .)
IsUserInPermissionList(PermissionList1)
It could be used with NOT function
if not(IsUserInRole("ADMIN")then
Hide(Field);
end-if

PeopleCode (String to number)

Thiscode help to cmpare string to number
Value(LTrim(&SAL_RANGE_MAX_RATE))> 100