UTL_FILE.PUT Adds 0D 0A when Writing EOF (chr(26)) on Windows. (Doc ID 1322965.1)

Last updated on JULY 05, 2017

Applies to:

PL/SQL - Version: 11.1.0.7 to 11.2.0.2.0 - Release: 11.1 to
Information in this document applies to any platform.

Symptoms

UTL_FILE.PUT always adds 0D 0A when writing EOF (chr(26)) on Windows.

Please see the following sample:

CREATE OR REPLACE DIRECTORY PUBTEST as 'C:\...\...';
GRANT read, write ON DIRECTORY PUBTEST to public;

create or replace PROCEDURE TEST3 AS
h_File UTL_FILE.FILE_TYPE;
--
BEGIN
h_file := UTL_FILE.FOPEN ('PUBTEST','EOF.txt','w');
UTL_FILE.PUT (h_file, 'T'||chr(26));
UTL_FILE.CLOSE (h_file);
END TEST3;
/
show errors;

exec test3;

--Result:
-----------
--54 1A 0D 0A



Cause

Sign In with your My Oracle Support account

Don't have a My Oracle Support account? Click to get started

My Oracle Support provides customers with access to over a
Million Knowledge Articles and hundreds of Community platforms