Caused exception message is: ORA-12704: Character Set Mismatch

Source: Internet
Author: User

This problem occurs when Union all is used to merge two result sets of select queries, the type of a field appears.

Different from the type of the corresponding field.

Because SQL is relatively long, one field is excluded. Finally found

Field bizdate: Select to_char (fbizdate, 'yyyy-mm-dd hh24: MI: ss') as bizdate --- fbizdate itself is datetime type to character type

Field ***: Select snumber ---- snumber does not know whether its data type can be a character, but does not know whether it is Char or varchar.

The problem occurs:

E. g:

Select to_char (fbizdate, 'yyyy-mm-dd hh24: MI: ss ')

Union all

Select snumber

I always thought that snumber is a character type, but it is indeed a character type, but also has char, varchar

So I made a mistake. Since the preceding fields are converted to Char, the following fields must also be converted to Char, that is, to_char (snumber)

Suddenly I found the database really annoying ..

 

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.