Solved

question about ddl

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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Migrate database to ASM disks. 1 39
Need a replacement data type in Oracle 6 65
Oracle - Create Procedure with Paramater 16 56
Export table into csv file in oracle 10 43
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…
From implementing a password expiration date, to datatype conversions and file export options, these are some useful settings I've found in Jasper Server.
This video shows how to set up a shell script to accept a positional parameter when called, pass that to a SQL script, accept the output from the statement back and then manipulate it in the Shell.
This video shows how to recover a database from a user managed backup

910 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

22 Experts available now in Live!

Get 1:1 Help Now