Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

question about ddl

Posted on 2014-02-19
7
Medium Priority
?
287 Views
Last Modified: 2014-03-19
Hi,
We have old database which shows ddl as char and new database which show ddl as bytes.

old

create aa
varchar2 (4 char)

new

create aa
varchar2 (4 Byte).


My question is
1) if we insert rows from 4  char to 4 byte will this be issue.
if yes then what should new database ddl should be.

2) I am seeing varchar2(4 byte ) for first time was that old way for creating ddls
0
Comment
Question by:sam2929
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 4
  • 3
7 Comments
 
LVL 77

Expert Comment

by:slightwv (䄆 Netminder)
ID: 39872015
The only difference between 4 char and 4 bytes comes from multi-byte character sets.

If you have them and 1 character is two bytes, the 4 char column can store 4 characters.  The 4 byte column can only store 2 characters.

Which is correct depends on your own specific needs.  We cannot tell you.
0
 

Author Comment

by:sam2929
ID: 39872046
Lets say i have Chinese character ¿¿ what will it do in that case for old and new ddl
0
 
LVL 77

Expert Comment

by:slightwv (䄆 Netminder)
ID: 39872060
>>Lets say i have Chinese character ¿¿

The character didn't come through and I'm not sure it would help me.

Which specific Chinese character set?  I'm far from an Expert on multi-byte character sets but I believe there are different ones that use a different number of bytes per single character.

>>what will it do in that case for old and new ddl

That depends on your specific requirements.  How many of the characters in the specific character set do you need to store in a single column?

It is pretty simple math:
Take the specific character sets you need to handle.
Take the largest bytes per character of all of them.
Take the largest number of characters of that character set  you need to store in a single column.
Set that column to that number/type (either CHAR or BYTES).
0
Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 

Author Comment

by:sam2929
ID: 39872099
lets say i have Chinese character ¿¿ how can i see how many bytes is this
0
 
LVL 77

Expert Comment

by:slightwv (䄆 Netminder)
ID: 39872106
Again, your Chinese characters aren't showing up with a copy/paste.

I don't know how to tell that character set a specific character is.

I would look at the specific software/system that generated it.
0
 

Author Comment

by:sam2929
ID: 39873093
Is this a problem we have data coming from SAP as CHAR  like varchar 2(4 char) .Data modler is creating stage tables in bytes but he is multiplying it
with three so we insert data in varchar2(12)byte table.

so looks like it will be ok as you explain earlier


I want to ask one thing if we compare varchar2(4 char) data with varchar2(12)byte data will there be any difference.
0
 
LVL 77

Accepted Solution

by:
slightwv (䄆 Netminder) earned 2000 total points
ID: 39873466
>>he is multiplying it with three

This may or may not be accurate.  It will allow 4 characters of a 3 Byte character set but it will also allow 12 characters of a single byte character set.

If the requirement is 4 characters, make it 4 characters.

>>if we compare varchar2(4 char) data with varchar2(12)byte data will there be any difference.

Data is data.
0

Featured Post

Ask an Anonymous Question!

Don't feel intimidated by what you don't know. Ask your question anonymously. It's easy! Learn more and upgrade.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Truncate is a DDL Command where as Delete is a DML Command. Both will delete data from table, but what is the difference between these below statements truncate table <table_name> ?? delete from <table_name> ?? The first command cannot be …
Checking the Alert Log in AWS RDS Oracle can be a pain through their user interface.  I made a script to download the Alert Log, look for errors, and email me the trace files.  In this article I'll describe what I did and share my script.
This video explains at a high level about the four available data types in Oracle and how dates can be manipulated by the user to get data into and out of the database.
This video shows information on the Oracle Data Dictionary, starting with the Oracle documentation, explaining the different types of Data Dictionary views available by group and permissions as well as giving examples on how to retrieve data from th…

609 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question