Thanks!
Dennis, September 01, 2004 - 12:19 pm UTC
Yeah I wasn't thrilled either. They can check the data as it's going in to find out if it's null or not. I'll see if we can prod them to some other manner, but I've not been successful so far.
Thanks for the autocommit idea. That would the nice and simple way to do it! In my spool file, the chr(13)||chr(10) shows up (but then again I'm in Notepad...). It's probably a non-issue.
I think I can make it do the commits on a line if I make that a result set that I then pivot. I wasn't thinking of looking for pivot earlier. But that's if I decide not to do it the nice and simple way.
Thanks.
Line feeds show up in windows editor - sent over from Unix dbms_output script
j.register, January 27, 2005 - 10:34 am UTC
How do I keep linesize at a constant but remove line feed characters '^r' from unix file (generated by dbms_output in pl/sql script) before I send it to a windows file server?
January 27, 2005 - 11:01 am UTC
trick question I think.
\r is not embedded in the file on unix, \n is.
on windows, it would have \r\n
so, not really sure where the \r's are coming from?
Ravi, July 04, 2005 - 11:05 am UTC
How about this function to remove any lines from a variable that contain a matching pattern of characters.
/* Formatted on 2005/07/04 15:48 (Formatter Plus v4.6.6) */
CREATE OR REPLACE FUNCTION rm_lines_with_text (
full_text IN VARCHAR2 DEFAULT NULL,
search_text VARCHAR2 DEFAULT NULL
)
RETURN VARCHAR2
AS
text VARCHAR2 (4000) := full_text;
n NUMBER (10);
temptext VARCHAR2 (4000) := NULL;
BUILD VARCHAR2 (4000) := NULL;
filtered_text VARCHAR2 (4000) := NULL;
curr_line VARCHAR2 (4000) := NULL;
act_search_text VARCHAR2 (4000) := search_text;
BEGIN
LOOP
n := INSTR (text, CHR (10), 1);
curr_line := SUBSTR (text, 1, CASE
WHEN NVL (n, 0) = 0 THEN LENGTH (text)
ELSE n - 1
END);
filtered_text :=
filtered_text
|| CASE
WHEN INSTR (UPPER (curr_line), UPPER (act_search_text), 1) > 0 THEN NULL
ELSE curr_line || (CHR (10))
END;
temptext := SUBSTR (text, n + 1, LENGTH (text));
text := temptext;
EXIT WHEN (n IS NULL OR n = 0);
END LOOP;
RETURN (filtered_text);
END;
/