Precompiler Program Loses Blank Padding if Earlier CLOB Fetch was Dynamic (Doc ID 1265326.1)

Last updated on JULY 05, 2017

In this Document
  Symptoms
  Cause
  Solution
  References


This document is being delivered to you via Oracle Support's Rapid Visibility (RaV) process and therefore has not been subject to an independent technical review.

Symptoms

Precompiler applications loose blank padding after upgrade to 11.1. The application does a dynamic fetch first before a second fetch when blank padding is lost.
This application worked in 10.2 and 9.2 installations.

We can see by the following results:

CREATE TABLE test_tab ( ID VARCHAR2(10))
INSERT INTO test_tab( ID) values ( '644');

(Snippet of code from precompiler application)

EXEC SQL CONNECT :user
EXEC SQL SELECT 'Hello' FROM dual
EXEC SQL SELECT ID INTO :v_id FROM test_tab

The results when "SELECT 'Hello' FROM dual" is included are:
(This is showing the ascii character of data fetched from a VARCHAR2(10) column which contains '644')

v_id = 644 
Char 1 = 54 (6)
Char 2 = 52 (4)
Char 3 = 52 (4)
Char 4 = 0 (NULL)
Char 5 = 0 (NULL)
Char 6 = 0 (NULL)
Char 7 = 0 (NULL)
Char 8 = 0 (NULL)
Char 9 = 0 (NULL)

When the "SELECT 'Hello' FROM dual" is commented out the result is blank padded:

v_id = 644
Char 1 = 54 (6)
Char 2 = 52 (4)
Char 3 = 52 (4)
Char 4 = 32 (blank space)
Char 5 = 32 (blank space)
Char 6 = 32 (blank space)
Char 7 = 32 (blank space)
Char 8 = 32 (blank space)
Char 9 = 32 (blank space)

We can see that the output is blank padded with ascii character 32.

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