Requires Free Membership to View
-- *********************
-- ** u n q u o t e **
-- *********************
-- unquote returns a copy of in_text with all doubled
-- occurrences of in_quote_text changed to single occurrences.
-- If in_text starts with quote_text, the starting quote is
-- removed first, and an equal length (assumed to be a closing
-- quote, but not checked that it is) is removed from the end.
FUNCTION unquote
(
in_text IN VARCHAR2,
in_quote_text IN VARCHAR2
)
RETURN VARCHAR2
IS
quote_len PLS_INTEGER := LENGTH (in_quote_text);
return_text VARCHAR2 (32767) := in_text;
BEGIN
IF in_quote_text IS NOT NULL
THEN
IF INSTR (in_text, in_quote_text) = 1
THEN
return_text := SUBSTR ( in_text,
1 + quote_len,
LENGTH (in_text) - (2 * quote_len)
);
END IF;
return_text := REPLACE ( return_text,
in_quote_text || in_quote_text,
in_quote_text
);
END IF;
RETURN return_text;
END unquote;
-- ******************************
-- ** Initialization Section **
-- ******************************
BEGIN
unclaimed_text := '';
END pk_csv;
/
GRANT EXECUTE ON csv.pk_csv TO csv_admin; This was first published in July 2003

Join the conversationComment
Share
Comments
Results
Contribute to the conversation