Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
Discussion Groups
Database Servers
DB2InformixIngresMS SQLOraclePervasive.SQLPostgreSQLProgressSybase
Desktop Databases
FileMakerFoxProMS AccessParadox
General
General DB TopicsDatabase Theory
Related Topics
Java Development.NET DevelopmentVB DevelopmentMore Topics ...

Database Forum / DB2 Topics / January 2005

Tip: Looking for answers? Try searching our database.

vargraphic column Question.

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Irfan Bondre - 20 Jan 2005 02:22 GMT
When I try to create a table with a vargraphic column I get the following
error.

CREATE TABLE EIITEST.IRFAN ("VARC" VARCHAR (48) , "VARGRA" VARGRAPHIC (96) )
DATA CAPTURE NONE IN USERSPACE1;
----------------------------------------------------------------------------
-
DB21034E The command was processed as an SQL statement because it was not a
valid Command Line Processor command. During SQL processing it returned:
SQL1216N Graphic data and graphic functions are not supported for this
database. SQLSTATE=56031

This is probably because my database is not setup as unicode or double byte.
But then wouldn't it mean that even my VARCHAR column can store unicode
data. Then whats the purpose of VARGRAHPIC

Irfan.
Serge Rielau - 20 Jan 2005 13:03 GMT
> When I try to create a table with a vargraphic column I get the following
> error.
[quoted text clipped - 13 lines]
>
> Irfan.

(VAR)GRAPHIC in Unicode (as an example) stores data is UCS-2 (16 bit per
charcter + substitution charcters). In (var) char UTF-8 is used.
LENGTH() on a graphic column will always return the character length for
 the first plane of Unicode. On the downside GRAPHIC on average uses
more  space. (var)char by contrast is byte based. a VARCHAR(10) holds at
most  10 characters, at worst 3 (I think). On average varchar uses less
space. E.g. if all your characters are ASCII you are down to 1 byte per
character.
VAR(GRAPHIC) is a DB2 proprietary type.
Out of interest may I ask what your intention is? Do you need Unicode in
a non-Unicode database? What are your options of migrating to all
Unicode instead? I'm asking because opinions vary on where to invest. So
I'm curious for feedback from the group.

Cheers
Serge

Signature

Serge Rielau
DB2 SQL Compiler Development
IBM Toronto Lab

Irfan Bondre - 20 Jan 2005 18:31 GMT
Thanks for the response Serge,
Our application deals with Varchar and Vargraphic ( for that matter varchar
and Nvarchar on other databases ) seamlessly.

So somebody could write a query which could get translated to Select
varchar_column_data || vargraphic_column_data from test_table.

In Oracle it seems the functions handle varchar and nvarchar data with out
any issue, in oracle the above query would return Nvarchar data.

The above query also works in DB2.

About Do you need Unicode in  a non-Unicode database? Can we have that in
DB2 V7.  It certainly possible in Oracle with Nvarchar.
However with DB2 V8.2, when I create a table with vargraphic column I get
the following error? Is there a work around for that?

CREATE TABLE EIITEST.IRFAN ("VARC" VARCHAR (48) , "VARGRA" VARGRAPHIC (96) )
DATA CAPTURE NONE IN USERSPACE1;

DB21034E The command was processed as an SQL statement because it was not a
valid Command Line Processor command. During SQL processing it returned:
SQL1216N Graphic data and graphic functions are not supported for this
database. SQLSTATE=56031

I there some useful reference for Vargraphic data and mixing varchar and
vargraphic data?

Thanks

Irfan.

> > When I try to create a table with a vargraphic column I get the following
> > error.
[quoted text clipped - 31 lines]
> Cheers
> Serge
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2009 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.