DS Function
DS Function
leftstr(string(<date_field>), 4)
TO_CHAR(sysdate, 'DD-MON-YYYY HH:MI:SS AM') NOW, TO_CHAR(sysdate+1/
(24*60*60),'DD-MON-YYYY HH:MI:SS AM') NOW_PLUS_1_SEC from dual;
replace_substr(ColumnName,chr('10'),'')
remove them using REPLACE_SUBSTR_EXT if you are going to search for only a
specific set of special char.
remove all the special characters in a string .How to do this?
For example @34!^78a5 should be changed to 3478a5.
match_regex(Query."EMPLOYEE NAME",literal('[a-zA-Z0-9]'),NULL)=1
In this example the data was CKI=ICD9!250.02 and the user required all the
values after the ! returned, i.e. 250.02. also went on to state that the number of
characters after the 250.02 may vary in length.
=(Length([Object])-Pos([Object];!))
=Right([Object];(Length([Object])-Pos([Object];!)))
need to remove all of the special characters on a standard keyboard leaving just
the alpha-numeric ones (A to Z and 0 to 9).
replace_substr_ext(replace_substr_ext(replace_substr_ext(Query_2.MFRPN,'+','',1
,20)
,'_','',1,20),'-','',1,20) ) )
The following statement will replace the dash with nothing (which is good);
replace_substr_ext(Query_2.MFRPN,'-','',1,20)
Remove -FX from string like: LR78S2N-FX
replace_substr(replace_substr(POS_VP_INPUT."Key 1 (Product)", '-FX',''),'',' ')
Q: MLR78S2N-FX(
Remove M from staring wherever and FX also (
Result: LR78S2N
Solution:
#decode(
#ltrim_blanks( rtrim_blanks( POS_VP_INPUT."Key 1 (Product)")) LIKE 'M
%',substr(ltrim_blanks( rtrim_blanks( POS_VP_INPUT."Key 1
(Product)")),2,length(ltrim_blanks( rtrim_blanks( POS_VP_INPUT."Key 1
(Product)")))),
#POS_VP_INPUT."Key 1 (Product)" LIKE '%%',word_ext( ltrim_blanks( rtrim_blanks( POS_VP_INPUT."Key 1 (Product)")),1,'-'),
#POS_VP_INPUT."Key 1 (Product)" LIKE '%
(%',word_ext( ltrim_blanks( rtrim_blanks( POS_VP_INPUT."Key 1 (Product)")),1,'('),
#ltrim_blanks( rtrim_blanks( POS_VP_INPUT."Key 1 (Product)")))
#decode(
#ltrim_blanks( rtrim_blanks( POS_VP_INPUT."Key 1 (Product)")) LIKE 'M
%',substr(ltrim_blanks( rtrim_blanks( POS_VP_INPUT."Key 1
(Product)")),2,length(ltrim_blanks( rtrim_blanks( POS_VP_INPUT."Key 1
(Product)")))),
#POS_VP_INPUT."Key 1 (Product)" LIKE '%%',word_ext( ltrim_blanks( rtrim_blanks( POS_VP_INPUT."Key 1 (Product)")),1,'-'),
#POS_VP_INPUT."Key 1 (Product)" LIKE '%
(%',word_ext( ltrim_blanks( rtrim_blanks( POS_VP_INPUT."Key 1 (Product)")),1,'('),
#ltrim_blanks( rtrim_blanks( POS_VP_INPUT."Key 1 (Product)")))
#decode(
#ltrim_blanks( rtrim_blanks( POS_VP_INPUT."Key 1 (Product)")) LIKE 'M
%','substr(ltrim_blanks( rtrim_blanks( POS_VP_INPUT."Key 1
(Product)")),2,length(ltrim_blanks( rtrim_blanks( POS_VP_INPUT."Key 1
(Product)")))),
#POS_VP_INPUT."Key 1 (Product)" LIKE '%%',word_ext( ltrim_blanks( rtrim_blanks( POS_VP_INPUT."Key 1 (Product)")),1,'-'),
#POS_VP_INPUT."Key 1 (Product)" LIKE '%
(%',word_ext( ltrim_blanks( rtrim_blanks( POS_VP_INPUT."Key 1 (Product)")),1,'('),
#ltrim_blanks( rtrim_blanks( POS_VP_INPUT."Key 1 (Product)")))
Name
2
EXT
YUN
Custom Function:(CF_StringRetrieve)
# Assign the input string to a local variable
$L_Stmnt = $P_InString ;
#Initialize loop counter
$L_LoopCounter = 35;
#Extracting the substring of the statement after first space, so that the
extra truncated part is removed
$L_StrRev = substr($L_StrRev, index( $L_StrRev, ' ', 1 ) , length( $L_StrRev
));
Return $L_Stmnt ;
Q:find the value of ' % ASSOC%' in the name and replace it to 'Assoc.' using ifthenelse.
SOL:
ifthenelse
(
Table.field_name like '%ASSOC%',replace_substr( Table.field_name,'ASSOC','Assoc.')
,Table.field_name
)
Sol:
decode(Table.field_name like '%ASSOC%, 'Assoc.' , ,Table.field_name)
decode(Table.field_name like '%ASSOC%, 'Assoc.' , ,Fail)