473,513 Members | 2,356 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

vargraphic column Question.

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.
Nov 12 '05 #1
2 10920
Irfan Bondre wrote:
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.

(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
--
Serge Rielau
DB2 SQL Compiler Development
IBM Toronto Lab
Nov 12 '05 #2
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.

"Serge Rielau" <sr*****@ca.ibm.com> wrote in message
news:35*************@individual.net...
Irfan Bondre wrote:
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.

(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
--
Serge Rielau
DB2 SQL Compiler Development
IBM Toronto Lab

Nov 12 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

12
3648
by: Philip Sherman | last post by:
I'm trying to copy production statistics to a test database and can't set the column statistics for a VARGRAPHIC column to match what RUNSTATS generated on production. The reason code and some...
1
6993
by: Lopezd9 | last post by:
My understanding is that GRAPHIC and VARGRAPHIC data types can store text encoded in UCS-2 in a Unicode database (ie when it is created so that CHAR is encoded in UTF-8). What is the encoding of...
0
1012
by: stevenkblack | last post by:
I just created a new database server and installed 8.2.2 so fix pack 9a on a windows server. I then created a database that was UTF-8 enabled. Country/Region Default Territory US Code page...
3
1536
by: ruca | last post by:
Hi, I have two different questions to ask: QUESTION 1: Can I create dinamically a column in a datagrid? How? I have a datagrid that must have 5 columns, but in some very special cases I have...
5
11784
by: Tim | last post by:
Hi, I am trying to move a datacolumn in a datatable. What I have tried so far is to create a new datacolumn set it equal to the one I want to remove and then remove it, add another column and...
40
4421
by: Mark | last post by:
Hello i like to make the following lay out: - 3 columns - center column = fixed width - left and right columns are not fixed and must take all the available space there is left. - left...
9
3846
by: weirdwoolly | last post by:
Hopefully someone will be able to help. I have written a stored procedure in C++ called from a Java test harness to validate the graphic data types in C++ and their use. I have declared the...
5
8287
by: dananrg | last post by:
Is there any way to retrieve column names from a cursor using the ODBC module? Or must I, in advance, create a dictionary of column position and column names for a particular table before I can...
3
2333
Lokean
by: Lokean | last post by:
Sorry for this newbie question, this is not my realm of expertese. I have searched google, tried several applications that claim they can do this, such as Mapforce, which I found confusing, to...
0
7265
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
7388
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
7545
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
7539
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
5692
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
1
5095
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
4751
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
3240
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
461
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.