0

I have this issue with SQLLoader. I am working with a dataset with 99 columns. Everything is being loaded to a VARCHAR2(500 BYTE) - I went through the data manually to make sure there was enough space in each column.

CSV Properties Comma delimited Line terminated by CRLF Text Qualifier '"'

The issue is, when I load the data manually (I use Toad for Oracle) - the data appears just fine. However, using my SQLLoader - it "successfully" loads all the data however when you query the table, the table has all the rows but all the data is missing. (Null values appear) - Can anyone help with this?

This is the ctl file code:

OPTIONS (direct=true)
LOAD DATA
  
  INFILE 'C:\Paths\DATA_PRCS\MarketData\FitchRatings\DBUpload\test.csv'
  DISCARDFILE  'C:\Paths\DATA_PRCS\MarketData\FitchRatings\DBUploadProcess\ErrorFiles\FitchIssue_Errors.csv'

    
  TRUNCATE INTO TABLE MARKETDATA.PRLD_FITCH_ISSUE_DATA
    fields terminated by "," OPTIONALLY ENCLOSED BY '"' trailing nullcols
    (
         REPORT_DATE_TIME
       , AGENT_COMMON_ID
       , AGENT_CUSIP
       , AGENT_LEI
       , CUSTOMER_IDENTIFIER
       , MARKET_SECTOR_ID
       , COUNTRY_NAME
       , ISSUER_ID
       , ISSUER_NAME
       , ISSUE_RECORD_CHANGE_CODE_DATE
       , FITCH_ISSUE_ID_NUMBER
       , COUNTRY_CODE
       , STATE_PROVINCE
       , CUSIP_IDENTIFIER
       , ISIN_IDENTIFIER
       , ISMA_IDENTIFIER
       , LOANX_ID
       , COMMON_NUMBER
       , WERTPAPIER_IDENTIFIER
       , RECORD_GROUP_TYPE_CODE
       , ISSUE_DEBT_LEVEL_CODE
       , CLASS_TYPE
       , ISSUE_DESCRIPTION
       , ISSUE_MATURITY_DATE
       , ISSUE_TRANCHE_SERIES
       , ISSUE_CLASS
       , ISSUE_CURRENCY_CODE
       , ISSUE_AMOUNT
       , ISSUE_COUPON_TYPE
       , ISSUE_COUPON_FIXED_RATE
       , ISSUE_COUP_NON_FIXED_RATE_DESC
       , ISSUE_COUPON_INDEX_DESCRIPTION
       , ISSUE_COUPON_SPREAD
       , ISSUE_COUPON_CAPPED_RATE
       , ENHANCEMENT_TYPE
       , ENHANCEMENT_PROVIDER
       , PROJECT
       , PRIVATE_PLACEMENT_144A_CODE
       , US_FED_TAX_EXEMPT_STATUS_CODE
       , ISSUE_RECORD_CHANGE_CODE
       , LT_ISSUE_RATING
       , LT_ISSUE_RATING_ACTION
       , LT_ISSUE_RATING_EFFECTIVE_DATE
       , LT_ISSUE_RATING_ALERT_CODE
       , LT_ISSUE_RATING_SOL_STATUS
       , ISSUE_RECOVERY_RATING
       , ISSUE_DISTRESSED_RECOV_RATING
       , UNENHANCED_LT_ISSUE_RATING
       , UNENHANCED_LTR_ACTION
       , UNENHANCED_LTR_EFFECTIVE_DATE
       , UNENHANCED_LTR_ALERT_CODE
       , UNENHANCED_LTR_SOL_STATUS
       , LT_NATIONAL_ISSUE_RATING
       , LT_NATIONAL_RATING_ACTION
       , LT_NATL_RATING_EFFECTIVE_DATE
       , LT_NATIONAL_RATING_ALERT_CODE
       , LT_NATIONAL_RATING_SOL_STATUS
       , ST_ISSUE_RATING
       , ST_ISSUE_RATING_ACTION
       , ST_ISSUE_RATING_EFFECTIVE_DATE
       , ST_ISSUE_RATING_ALERT_CODE
       , ST_ISSUE_RATING_SOL_STATUS
       , UNENHANCED_ST_ISSUE_RATING
       , UNENHANCED_STR_ACTION
       , UNENHANCED_STR_EFFECTIVE_DATE
       , UNENHANCED_STR_ALERT_CODE
       , UNENHANCED_STR_SOL_STATUS
       , ST_NATIONAL_ISSUE_RATING
       , ST_NATIONAL_RATING_ACTION
       , ST_NATL_RATING_EFFECTIVE_DATE
       , ST_NATIONAL_RATING_ALERT_CODE
       , ST_NATIONAL_RATING_SOL_STATUS
       , ENHANCED_LTR
       , ENHANCED_LTR_ACTION
       , ENHANCED_LTR_EFFECTIVE_DATE
       , ENHANCED_LTR_ALERT_CODE
       , ENHANCED_LTR_SOL_STATUS
       , ENHANCED_STR
       , ENHANCED_STR_ACTION
       , ENHANCED_STR_EFFECTIVE_DATE
       , ENHANCED_STR_ALERT_CODE
       , ENHANCED_STR_SOL_STATUS
       , SECURITY_IDENTIFIER_TYPE
       , ENDORSEMENT_COMPLIANCE
       , RATINGS_SUFFIX
       , CLO_SECTOR
       , CLO_INDUSTRY
       , ALTERNATE_CUSIP
       , ALTERNATE_ISIN
       , DATA_ENTRY_TIMESTAMP expression "(select SYSDATE from dual)"

    ) 
4
  • Showing real data to be input and the log file would be helpful. Commented Oct 12, 2021 at 13:29
  • drive.google.com/drive/folders/… Commented Oct 12, 2021 at 13:50
  • I have added the file and the log Commented Oct 12, 2021 at 13:50
  • I am quite convinced now that it is the file structure that cannot be read properly. But not sure how I can do this. Commented Oct 12, 2021 at 13:54

1 Answer 1

1

Rather simple in the end. The most important thing to realize was that the file was using Unicode characters. You have to specify in the ctl file CHARACTERSET UT16 in this example. Thank for trying to help all!

load data CHARACTERSET UTF8 TRUNCATE INTO TABLE "GLOBALIZATIONRESOURCE" FIELDS TERMINATED BY "," OPTIONALLY ENCLOSED BY '"' TRAILING NULLCOLS

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.