Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

The solution of garbled data imported by sqlldr

2025-01-17 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Database >

Share

Shulou(Shulou.com)05/31 Report--

This article introduces the relevant knowledge of "the solution to garbled data imported by sqlldr". In the operation of actual cases, many people will encounter such a dilemma, so let the editor lead you to learn how to deal with these situations. I hope you can read it carefully and be able to achieve something!

The company's business needs, import data through sqlldr for statistics, the data source is the counter software exported excel, and then converted to csv format, through sqlldr import database.

Control file fjf.ctl:

Load data

CHARACTERSET ZHS16GBK

Infile'D:\ 20180927\ 9\ 20180903 20180903.csv'

Append

Into table hs_his.fjf

Fields terminated by','

TRAILING NULLCOLS

(

Exch_type

Futucode_type

Hands

Money

Shouxf

Fjf1

Fjf2

Jlc

)

Bat file:

@ Echo *

@ Echo * Import surcharge data!

@ Echo * Please press enter to import data!! * *

@ Echo *

Pause

Sqlldr system/oracle@uf20 control=D:\ 20180927\ 9\ fjf.ctl log=D:\ 20180927\ 9\ fjf.log bad=D:\ 20180927\ 9\ fjf.bad

Pause

After import, the query shows garbled codes.

SQL > select exch_type from hs_his.fjf

EXCH_TYPE

-

Thank you for your failure.

I don't know what to do.

I don't know what to do.

I don't know what to do.

I don't know what to do.

A little trickle-down, a trickle-down.

I don't know what to do.

I don't know what to do.

I don't know what to do.

I don't know what to do.

I don't know what to do.

Query database character set: select * from nls_database_parameters

SQL > show parameters nls_lang

NAME TYPE VALUE

-

Nls_language string SIMPLIFIED CHINESE

SQL > show parameters nls

NAME TYPE VALUE

-

Nls_calendar string GREGORIAN

Nls_comp string BINARY

Nls_currency string

Nls_date_format string DD-MON-RR

Nls_date_language string SIMPLIFIED CHINESE

Nls_dual_currency string

Nls_iso_currency string CHINA

Nls_language string SIMPLIFIED CHINESE

Nls_length_semantics string BYTE

Nls_nchar_conv_excp string FALSE

Nls_numeric_characters string.

NAME TYPE VALUE

-

Nls_sort string BINARY

Nls_territory string CHINA

Nls_time_format string HH.MI.SSXFF AM

Nls_time_tz_format string HH.MI.SSXFF AM TZR

Nls_timestamp_format string DD-MON-RR HH.MI.SSXFF AM

Nls_timestamp_tz_format string DD-MON-RR HH.MI.SSXFF AM TZR

Character set of session:

Client character set:

There is nothing wrong with the database character set.

Suspect is the coding problem of the data source.

Modify the character set in the ctl file to: AL32UTF8

Load data

CHARACTERSET AL32UTF8

Infile'D:\ 20180927\ 9\ 20180903 20180903.csv'

Append

Into table hs_his.fjf

Fields terminated by','

TRAILING NULLCOLS

(

Exch_type

Futucode_type

Hands

Money

Shouxf

Fjf1

Fjf2

Jlc

)

Re-import, problem solving

This is the end of the content of "solution to garbled data imported by sqlldr". Thank you for your reading. If you want to know more about the industry, you can follow the website, the editor will output more high-quality practical articles for you!

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Database

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report