I am currently extracting data into a file using the following script:
All of the fields are VARCHAR2, except for CONTACT_ID which is a NUMBER field.
The database is using UTF8 for NLS_CHARACTERSET.
A record contains the following in the ADDRESS_LINE_1 field:
VIA DEI SALICI N°38
This record is one character longer than all the other records (despite the 'linesize' setting). It seems to have inserted a space in the ADDRESS_LINE_1 field. When I extract a greater number of records I notice that this happens for all records with diacritical characters in them.
I will be using the spooled file to import into parsing and cleansing software (Trillium) which requires a fixed length of record. These extra spaces are therefore causing this import to fail.
Any ideas?
Thanks.
Code:
set linesize 1180
set pagesize 0
set head off
set term off
set wrap off
column CONTACT_ID format 9999999999
column FIRST_NAME format a78
column LAST_NAME format a78
column JOB_TITLE format a78
column ADDRESS_LINE_1 format a78
column ADDRESS_LINE_2 format a78
column ADDRESS_LINE_3 format a78
column ADDRESS_LINE_4 format a78
column CITY format a78
column STATE format a78
column POSTAL_CODE format a78
column COUNTRY format a78
column LAST_SOURCE_SYSTEM format a78
column COMPANY_NAME format a78
column COUNTY format a78
column NVL(STATE,COUNTRY) format a78
spool uk_contacts
select * from
(select
a.CONTACT_ID,
a.FIRST_NAME,
a.LAST_NAME,
a.JOB_TITLE,
ADDRESS_LINE_1,
ADDRESS_LINE_2,
ADDRESS_LINE_3,
ADDRESS_LINE_4,
CITY,
NVL(STATE,COUNTY),
ZIP_POSTAL_CODE,
COUNTRY,
a.LAST_SOURCE_SYSTEM,
COMPANY_NAME,
COUNTY
from cccadm.gcr_contacts_ss a, cccadm.gcr_postal_ss b
where a.contact_id = b.contact_id
and country_of_origin = 'UK')
where rownum < 2000;
spool off
set term on
set wrap on
All of the fields are VARCHAR2, except for CONTACT_ID which is a NUMBER field.
The database is using UTF8 for NLS_CHARACTERSET.
A record contains the following in the ADDRESS_LINE_1 field:
VIA DEI SALICI N°38
This record is one character longer than all the other records (despite the 'linesize' setting). It seems to have inserted a space in the ADDRESS_LINE_1 field. When I extract a greater number of records I notice that this happens for all records with diacritical characters in them.
I will be using the spooled file to import into parsing and cleansing software (Trillium) which requires a fixed length of record. These extra spaces are therefore causing this import to fail.
Any ideas?
Thanks.