Solved

nvarchar in mssql

Posted on 2009-04-06
4
1,452 Views
Last Modified: 2012-05-06
Does oracle have nvarchar if I plan to write application that work with bot mssql and oracle what should I do
0
Comment
Question by:teera
[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 Comments
 
LVL 25

Assisted Solution

by:lwadwell
lwadwell earned 100 total points
ID: 24083564
Yes it does,  but like Oracle prefers VARCHAR2 instead of VARCHAR ... NVARCHAR is called NVARCHAR2 in Oracle!

http://www.orafaq.com/wiki/NVARCHAR2
0
 
LVL 57

Assisted Solution

by:Raja Jegan R
Raja Jegan R earned 100 total points
ID: 24083585
If you want to store non-Unicode characters use VARCHAR in MSSQL and VARCHAR2 in Oracle.
If you want to store Unicode characters use NVARCHAR in MSSQL and NVARCHAR2 in Oracle.
0
 
LVL 40

Accepted Solution

by:
mrjoltcola earned 200 total points
ID: 24083810
As to creating type "synonyms" or SQL domains to match SQL Server, Oracle doesn't support the standard SQL DOMAIN (annoying) but you can create a Oracle type, but it will probably not solve your issue of being able to use a common DDL, because you cannot give lengths to the types, that I am aware of.

create or replace type nvarchar as object ( field nvarchar2(500) );

create table mytab
(
   f1 nvarchar
);

But you cannot do:

create table mytab
(
  f1 nvarchar(100)
);


But there are more mapping issues between Oracle <-> SQL Server than just column type names.

I don't try to manage a single DDL, I use an ER tool to maintain a logical model and generate multiple physical models from those. Embarcadero ER/Studio is very good at this, and there are others.

I have schemas that I maintain and I can generate Oracle, Sybase and SQL Server physical models, and keep them in sync by changing only the logical model.

Also, when synching changes made manually from a database, you can sync it back to the logical model, then forward to the dependant physical models.

If you do a lot of this type of work, the investment in a tool like this (3k) pays for itself within a short time. You must learn the tool well, though. I don't recommend ERwin for this as I have had problems with the "complete compare" crashing, which is why I moved to Embarcadero 2 yrs ago.

0
 
LVL 48

Assisted Solution

by:schwertner
schwertner earned 100 total points
ID: 24084808
In Oracle the character set of the Data base is in high impartance.
The character set should be able to store the letters of the alphabet
you use.
The most universal characters set is AL32UTF8.

After your DBA ensures this you can store the data in VARCHAR2 columns.
Normaly the semantic is in bytes (keep in mind that some Unicode letters need
more then one byte per letter). Example:  
name VARCHAR2 (89),

But you can also use "character semantic - the length is declared in number of characters (but not greater then 4000 bytes). Example:

name VARCHAR2 (89 char),


0

Featured Post

What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

Question has a verified solution.

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

A company’s centralized system that manages user data, security, and distributed resources is often a focus of criminal attention. Active Directory (AD) is no exception. In truth, it’s even more likely to be targeted due to the number of companies …
Your data is at risk. Probably more today that at any other time in history. There are simply more people with more access to the Web with bad intentions.
This video shows how to Export data from an Oracle database using the Original Export Utility.  The corresponding Import utility, which works the same way is referenced, but not demonstrated.
Polish reports in Access so they look terrific. Take yourself to another level. Equations, Back Color, Alternate Back Color. Write easy VBA Code. Tighten space to use less pages. Launch report from a menu, considering criteria only when it is filled…

626 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