473,795 Members | 2,418 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 10969
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_colu mn_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******** *****@individua l.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
3687
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 testing I did indicates that the length of the low2key value is too long. It almost looks like the potential length of data to be stored is being calculated on the length of the hex string; without consideration that two bytes of the string...
1
7019
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 GRAPHIC in a non Unicode database ? I have not found any documentation that explains this clearly. Thanks David
0
1029
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 UTF-8 Collating Sequence System When I crate a table with the GUI I don't see the Graphic and Vargrahic
3
1548
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 to add another column. How can I do this in code? QUESTION 2:
5
11798
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 add it back again in the place I want it. tableStyle.MappingName = "DVGlobalPrices"; System.Data.DataColumn dCol = new DataColumn();
40
4493
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 column has a background picture - right column has another background picture
9
3878
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 vargraphic input parameters along the following lines in i_vargraphic100 vargraphic(100) and they are populated from String's in java.
5
8320
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 access column values by column names? I'd prefer sticking with the ODBC module for now because it comes standard in Python. I'm using Python 2.4 at the moment. Thanks.
3
2346
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 Oxygen, to HTML kit, et cetera. I am more confused than ever. here's my quandry. I was sent a file and told that we need to get the data into a more readable form. I've tried using apps to pull it in, but it's not displaying properly.
0
9519
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10214
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
10001
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
9042
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, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7540
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 presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6780
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 then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5437
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 last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5563
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4113
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system

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.