473,385 Members | 1,848 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,385 software developers and data experts.

GUID

Hi folks,

i have a db2-database and a frontend where i create some rows and
insert them into my database.

unfortunately the solution with autoincrement-pk isn't working for me
and a solution with stored procedures isn't wanted either because I
want to use this tool offline sometimes and only propagate the new
entries into the database.

my question now is: how "long" would a GUID be in db2? or, is a GUID a
varchar?

I hope you understood my question and you can give me a hint :-)

Greetings
Christopher

Jan 31 '07 #1
3 7968
Christopher wrote:
Hi folks,

i have a db2-database and a frontend where i create some rows and
insert them into my database.

unfortunately the solution with autoincrement-pk isn't working for me
and a solution with stored procedures isn't wanted either because I
want to use this tool offline sometimes and only propagate the new
entries into the database.

my question now is: how "long" would a GUID be in db2? or, is a GUID a
varchar?

I hope you understood my question and you can give me a hint :-)
DB2 has no built-in generator for GUID. But a simple Java UDF should do
the trick: http://java.sun.com/j2se/1.5.0/docs/...util/UUID.html
UUIDs are ASCII 36 characters formatted (hex plus dashes) and 16 Bytes data.
Also see APARs IY90142 and IY90251 for built-in functiosn to convert
between the two versions.

--
Serge Rielau
DB2 Solutions Development
IBM Toronto Lab
Jan 31 '07 #2
On Jan 31, 6:46 am, "Christopher" <chrishunn...@gmail.comwrote:
Hi folks,

i have a db2-database and a frontend where i create some rows and
insert them into my database.

unfortunately the solution with autoincrement-pk isn't working for me
and a solution with stored procedures isn't wanted either because I
want to use this tool offline sometimes and only propagate the new
entries into the database.

my question now is: how "long" would a GUID be in db2? or, is a GUID a
varchar?

I hope you understood my question and you can give me a hint :-)

Greetings
Christopher
Hi, Chris:

Could the GENERATE_UNIQUE function be of some use to you?

--Jeff

Jan 31 '07 #3
Oh sorry, I forgot to say that I am using .NET to program my frontend
(especially C#). I am creating the IDs within my application and to do
so I am using the
Guid tempGuid = Guid.newGuid();
function.

At the moment I have another problem with the id-column. In .NET you
have Bindingsources and I am setting a Filter to show some data.
Before I changed my Ids to Guid I could set the Filter like that
.... bindingsource.filter = "Id = ' " +myByteArray+" ' ";
But now my application throws an exception and tells me that i can't
compare string to byte.

Now I am looking for a solution to set the bindingsource filter
properly.

Greetings
Chris

Feb 1 '07 #4

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

Similar topics

4
by: Louis Frolio | last post by:
Greetings All, I have read many upon many articles here regarding GUID data types and uniqueness. There have been many opinions regarding the effectiveness of GUID's and when they should/should...
6
by: Jim Heavey | last post by:
When I use the new(Guid), the GUID which is generated is all zeros. Is there a technique for the system to assign a real Guid? Do I have to manually calculate a GUID?
9
by: Rene | last post by:
I am using the Guid.Empty value ("00000000-0000-0000-0000-000000000000") to represent a special meaning. The problem is that I don't know if there is a chance that a command like...
14
by: Nak | last post by:
Hi there, Does anyone know how I would get the value of the assembly GUID in code from within the same application? Thanks in advance. Nick. --...
5
by: rcolby | last post by:
Evening, Wondering if someone can point me in the right direction, on how I would compare a system.guid with a system.byte. system.guid (pulled from sql server table with a data type of...
5
by: George | last post by:
I want to create a unique id for each of a set of objects. These ids may be generated on multiple machines simultaneously and must all be different to each other. There are an undefined number...
1
by: Wolf | last post by:
Hi I am trying to set a property(PartyHomeAddressID) = to a guid in a ini file. But everytime when the ini file has an empty guid it breaks with an error tellin me a guid is 32 char long with 4...
5
by: Michael Primeaux | last post by:
I have a simple .NET 2.0 web service created with VS.NET 2005 with a single web method with the following signature: void HelloWorld(Guid parameter1); When calling this method I receive the...
2
by: Troll | last post by:
Windows XP Pro VS 2005 & C# (I'm fairly new to C# but have doing VB.Net going on 2yrs and VB6 for 5yrs.) I'm using C# to build a custom RSS generator. I'm having trouble building the guid...
4
by: Marc | last post by:
Hi, I don't get it I cannot get this to work, can somebody give me a hint Table1 contains a field Id which is a GUID as primary key and DATA a string, I want to insert a new row but it does not...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
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
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...
0
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...

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.