Solved

question about ddl

Posted on 2014-02-19
7
281 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 500 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

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!

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Email query results in HTML 6 46
Oracle perfomance issue. 4 46
SQL Syntax Question 9 52
oracle sql developer + get hour from datetime field 2 21
Introduction A previously published article on Experts Exchange ("Joins in Oracle", http://www.experts-exchange.com/Database/Oracle/A_8249-Joins-in-Oracle.html) makes a statement about "Oracle proprietary" joins and mixes the join syntax with gen…
Configuring and using Oracle Database Gateway for ODBC Introduction First, a brief summary of what a Database Gateway is.  A Gateway is a set of driver agents and configurations that allow an Oracle database to communicate with other platforms…
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 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

734 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