?
Solved

question about ddl

Posted on 2014-02-19
7
Medium Priority
?
285 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
Prepare for your VMware VCP6-DCV exam.

Josh Coen and Jason Langer have prepared the latest edition of VCP study guide. Both authors have been working in the IT field for more than a decade, and both hold VMware certifications. This 163-page guide covers all 10 of the exam blueprint sections.

 

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

 [eBook] Windows Nano Server

Download this FREE eBook and learn all you need to get started with Windows Nano Server, including deployment options, remote management
and troubleshooting tips and tricks

Question has a verified solution.

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

Why doesn't the Oracle optimizer use my index? Querying too much data Most Oracle developers know that an index is useful when you can use it to restrict your result set to a small number of the total rows in a table. So, the obvious side…
This post first appeared at Oracleinaction  (http://oracleinaction.com/undo-and-redo-in-oracle/)by Anju Garg (Myself). I  will demonstrate that undo for DML’s is stored both in undo tablespace and online redo logs. Then, we will analyze the reaso…
This video explains at a high level with the mandatory Oracle Memory processes are as well as touching on some of the more common optional ones.
This video shows setup options and the basic steps and syntax for duplicating (cloning) a database from one instance to another. Examples are given for duplicating to the same machine and to different machines

764 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