| \SPEC_ _STR.pdl\\ | ||
| SUMMARY: FIELD | TYPE | METHOD | DETAIL: FIELD | TYPE | METHOD | |
| Type Summary | |
RECORD | rec_str(string_value VARCHAR2(4000))
TYPE is a record of string for string procesing |
TABLE OF VARCHAR2(4000) INDEX BY null | tab_split()
Type is a collection/array of values returned from the split_array function |
TABLE OF row_str INDEX BY null | tab_str()
TYPE is a table of rec_str |
| Method Summary | |
BOOLEAN | is_date(in_value VARCHAR2)
Function will return a boolean TRUE if a string passed to the function is an exceptable date. |
VARCHAR2 | is_date_format()
Function will return the last date format used to evaluate a date with the is_date function and the is_date_sql function. |
VARCHAR2 | is_date_sql(in_value VARCHAR2)
Function evaluates a date in the same way as is_date but returns a VARCHAR2 value of 'TRUE' if the string is a date or a value of 'FALSE' if it is not. |
BOOLEAN | is_lower_case(in_string VARCHAR2)
Function returns a TRUE if all characters in string are Lower Case |
BOOLEAN | is_mixed_case(in_string VARCHAR2)
Function will return a BOOLEAN TRUE if string passed to it has mixed case. |
BOOLEAN | is_number(in_value VARCHAR2)
Function will return a boolean TRUE if a string passed to the function is a numeric value for example
BEGIN
If str.is_number('3') Then
DBMS_OUTPUT.PUT_LINE('True');
Else
DBMS_OUTPUT.PUT_LINE('False');
End If;
END;
|
VARCHAR2 | is_number_sql(in_value VARCHAR2)
Function will return a VARCHAR2 value of 'TRUE' if a string passed to the function is a numeric value, else it will return a value of 'FALSE'. |
BOOLEAN | is_ordinal(in_value VARCHAR2)
Function will return a boolean TRUE if the string passed is an ordinal (1st, 2cd, 3rd etc.). |
VARCHAR2 | is_ordinal_sql(in_value VARCHAR2)
Function returns like is_ordinal but instead returns a VARCHAR2 value of 'TRUE' if the string passed is an ordinal or returns a value of 'FALSE' if it is not. |
BOOLEAN | is_roman_numeral(in_value VARCHAR2)
Function returns a boolean TRUE if the string passes is a roman numeral. |
VARCHAR2 | is_roman_numeral_sql(in_value VARCHAR2)
Function returns like is_roman_numeral but instead returns a VARCHAR2 value of 'TRUE' if the string passed is a roman numeral or returns a value of 'FALSE' if it is not. |
BOOLEAN | is_upper_case(in_string VARCHAR2)
Function returns a TRUE if all characters in string are upper Case |
VARCHAR2 | remove_dbl_space(in_value VARCHAR2, in_char VARCHAR2)
Function will remove double space from a string and replace them with a single space. |
VARCHAR2 | split(in_del_field VARCHAR2, in_pos NUMBER, in_del VARCHAR2)
Function will split a string. |
tab_split | split_array(in_del_field VARCHAR2, in_del VARCHAR2)
Funciton takes a string passed to it and returns it as a collection of the type tab_split. |
tab_str | split_pipe(in_del_field VARCHAR2, in_del VARCHAR2)
Pipelined Function returns a table of one column with the deleminted string passed to it. |
VARCHAR2 | title(in_value VARCHAR2)
Function works similiar to UPPER and LOWER builtins except that it upper cases Only the first letter of each word and lower cases the rest of the word. |
VARCHAR2 | toggle(in_value VARCHAR2)
Function will Toggle the case of string, so what was upper is no lower and vice versa. |
| Type Detail |
public RECORD rec_str(string_value VARCHAR2(4000))
public TABLE OF row_str INDEX BY null tab_str()
public TABLE OF VARCHAR2(4000) INDEX BY null tab_split()
| Method Detail |
public VARCHAR2 split(in_del_field VARCHAR2,
in_pos NUMBER,
in_del VARCHAR2)
SQL> select str.split('a,b,c,d',3,',') from dual;
STR.SPLIT('A,B,C,D',3,',')
--------------------------------------------------------------------------------
c
select str.split('a,b,c,d',3,',') from dual;
in_del_field -
string to be splitin_del -
delimter to split bypublic tab_split split_array(in_del_field VARCHAR2,
in_del VARCHAR2)
DECLARE
t_split str.tab_split := str.split_array('a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u,v,w,x,y,z',',');
i INTEGER;
BEGIN
FOR i IN t_split.FIRST .. t_split.LAST LOOP
DBMS_OUTPUT.PUT_LINE(t_split(i));
END LOOP;
END;
/
in_del_field -
string to be splitin_del -
delimter to split bypublic tab_str split_pipe(in_del_field VARCHAR2,
in_del VARCHAR2)
SELECT *
FROM TABLE(str.split_pipe('a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u,v,w,x,y,z',','))
in_del_field -
string to be splitin_del -
delimter to split bypublic BOOLEAN is_upper_case(in_string VARCHAR2)
in_string -
String that could be upper casepublic BOOLEAN is_lower_case(in_string VARCHAR2)
in_string -
String that could be Lower casepublic BOOLEAN is_mixed_case(in_string VARCHAR2)
in_string -
String that could contain mixed casepublic BOOLEAN is_number(in_value VARCHAR2)
BEGIN
If str.is_number('3') Then
DBMS_OUTPUT.PUT_LINE('True');
Else
DBMS_OUTPUT.PUT_LINE('False');
End If;
END;
in_value -
Value that is evaluated to see if it is a numberpublic VARCHAR2 is_number_sql(in_value VARCHAR2)
SQL> SELECT str.is_number_sql('10') FROM dual;
str.IS_NUMBER_SQL('10')
--------------------------------------------------------------------------------
TRUE
in_value -
Value that is evaluated to see if it is a numberpublic BOOLEAN is_ordinal(in_value VARCHAR2)
in_value -
String to be evaluatedpublic VARCHAR2 is_ordinal_sql(in_value VARCHAR2)
in_value -
Value that is evaluated to see if it is an ordinalpublic BOOLEAN is_roman_numeral(in_value VARCHAR2)
For Example...
BEGIN
IF str.is_roman_numeral('XXsII') THEN
Dbms_Output.Put_Line('true');
ELSE
Dbms_Output.Put_Line('false');
END IF;
END;
in_value -
String to be evaluatedpublic VARCHAR2 is_roman_numeral_sql(in_value VARCHAR2)
SQL> SELECT str.is_roman_numeral_sql('XXII') FROM DUAL;
STR.IS_ROMAN_NUMERAL_SQL('XXII')
--------------------------------------------------------------------------------
TRUE
SQL>
in_value -
Value that is evaluated to see if it is an ordinalpublic BOOLEAN is_date(in_value VARCHAR2)
BEGIN
If str.is_date('5-dec-2004') Then
DBMS_OUTPUT.PUT_LINE('True');
Else
DBMS_OUTPUT.PUT_LINE('False');
End If;
END;
in_value -
Value that is evaluated to if it is a datepublic VARCHAR2 is_date_sql(in_value VARCHAR2)
SQL> select str.is_date_sql('10-dec-2004') from dual;
STR.IS_DATE_SQL('10-DEC-2004')
--------------------------------------------------------------------------------
TRUE
in_value -
Value that is evaluated to if it is a datepublic VARCHAR2 is_date_format()
SQL> select str.is_date_sql('10-dec-2004') from dual;
STR.IS_DATE_SQL('10-DEC-2004')
--------------------------------------------------------------------------------
TRUE
SQL> select str.is_date_format from dual;
IS_DATE_FORMAT
--------------------------------------------------------------------------------
DDMMYYYY
SQL>
public VARCHAR2 title(in_value VARCHAR2)
SQL> SELECT str.title('joe garrepy') FROM dual;
str.TITLE('JOEGARREPY')
--------------------------------------------------------------------------------
Joe Garrepy
SQL>
in_value -
in_value is the string to be formatedpublic VARCHAR2 toggle(in_value VARCHAR2)
SQL> SELECT str.toggle('Toggle Case') FROM dual;
str.TOGGLE('TOGGLECASE')
--------------------------------------------------------------------------------
tOGGLE cASE
SQL>
in_value -
in_value is the string to be formatedpublic VARCHAR2 remove_dbl_space(in_value VARCHAR2,
in_char VARCHAR2)
SQL> select str.remove_dbl_space('Test of double space .') from dual;
str.REMOVE_DBL_SPACE('TESTOFDOUBLESPACE.')
--------------------------------------------------------------------------------
Test of double space .
SQL>
in_value -
Value that will have all double space removed from it.in_char -
Character that you want to replace double occurances out
| ||||