Humble Trader

Wednesday, September 13, 2006

Warehouse Libraries - Package CTL.LIB_STRING Specification

  • Package: lib_string
  • Description: A set of library functions and procedures to support string manipulation.
    • Function: ltrim_chr
      • Description: Strips all of the specified character from the start of the string.
      • Parameters:
        • p_string:
          • Datatype: VARCHAR2
          • Direction: IN
          • Description: String to be stripped.
        • p_chr:
          • Datatype: VARCHAR2
          • Direction: IN
          • Description: Character strip target.
      • Return:
        • Datatype: VARCHAR2
        • Description: Stripped string.
      • Action:
        • For each character in the string...
          • If the current character matches the target character...
          • OR
          • The end of the string has been reached...
            • Select this character position as the cut point.
          • End; If the current character matches the target character.
        • End; For each character in the string.
        • If the cut point is the end of the string...
          • Return the null string.
        • Else
          • Return the string cut to the cut point.
        • End; If the cut point is the end of the string.
    • Function: count_chr
      • Description: Returns a count of the total number of target character in the string.
      • Parameters:
        • p_string:
          • Datatype: VARCHAR2
          • Direction: IN
          • Description: String to be searched.
        • p_chr:
          • Datatype: VARCHAR2
          • Direction: IN
          • Description: Character search target.
      • Return:
        • Datatype: NUMBER
        • Description: Count of target character in string.
      • Action:
        • Set the target character count to zero.
        • For each character in the string...
          • If the current character matches the target character...
            • Increment the target character count.
          • End; If the current character matches the target character.
        • End; For each character in the string.
        • Return the target character count.

0 Comments:

Post a Comment

<< Home