Solved

question about ddl

Posted on 2014-02-19
7
270 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
  • 4
  • 3
7 Comments
 
LVL 76

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 76

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
PRTG Network Monitor: Intuitive Network Monitoring

Network Monitoring is essential to ensure that computer systems and network devices are running. Use PRTG to monitor LANs, servers, websites, applications and devices, bandwidth, virtual environments, remote systems, IoT, and many more. PRTG is easy to set up & use.

 

Author Comment

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

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 76

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

PRTG Network Monitor: Intuitive Network Monitoring

Network Monitoring is essential to ensure that computer systems and network devices are running. Use PRTG to monitor LANs, servers, websites, applications and devices, bandwidth, virtual environments, remote systems, IoT, and many more. PRTG is easy to set up & use.

Join & Write a Comment

Suggested Solutions

Article by: Swadhin
From the Oracle SQL Reference (http://download.oracle.com/docs/cd/B19306_01/server.102/b14200/queries006.htm) we are told that a join is a query that combines rows from two or more tables, views, or materialized views. This article provides a glimps…
This article started out as an Experts-Exchange question, which then grew into a quick tip to go along with an IOUG presentation for the Collaborate confernce and then later grew again into a full blown article with expanded functionality and legacy…
This video shows how to copy a database user from one database to another user DBMS_METADATA.  It also shows how to copy a user's permissions and discusses password hash differences between Oracle 10g and 11g.
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.

743 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

Need Help in Real-Time?

Connect with top rated Experts

11 Experts available now in Live!

Get 1:1 Help Now