Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 5929107
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 22, 20262026-05-22T14:22:40+00:00 2026-05-22T14:22:40+00:00

Im working with IBM DB2 and there is no GUID(uniqueidentifier) datatype there. Instead there

  • 0

Im working with IBM DB2 and there is no GUID(uniqueidentifier) datatype there. Instead there is char for binary. When i create entity database model from that database- that type is identified as byte[] in the model. When i use model directly with database-everything works just fine(accepts Guid.NewGuid().ToByteArray() as primary key/entity key), but i MUST use service layer. So i have chosen WCF Data Service model for the layer and added same database model there. After trying to add service reference i keep getting error:
The custom tool ‘DataServiceClientGenerator’ failed. Data service client code-generation failed: Schema specified is not valid. Errors:
(0,0) : error 0129: The property ‘ID’ in EntityType ‘Model.TEST’ is not valid. EntityKey properties that are of type ‘Binary’ are currently not supported..

Does that mean that there is no way i can use tables with binary as PK?

PS by the way about datatypes in DB2: what do you suggest me to use in db2 to allow simple copying data from one table to another between different db servers?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-22T14:22:41+00:00Added an answer on May 22, 2026 at 2:22 pm

    DB2 allows binary data in smaller columns that can also serve as unique keys, but you’ll have to assign the unique ID either as part of the INSERT statement or from a trigger. The FOR BIT DATA qualifier is used in the CREATE TABLE statement to tell DB2 that the CHAR or VARCHAR column you’ve defined will store binary values.

    DB2’s internal unique function is called GENERATE_UNIQUE() and it returns a CHAR(13) FOR BIT DATA value that is guaranteed to be unique within the database (both on single-partition DB2 servers, and InfoSphere Warehouse clustered DB2 databases). If you want to store larger GUIDs that come from a layer outside the DBMS, you should be able to store them in a CHAR/VARCHAR FOR BIT DATA COLUMN.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Working with an Oracle 9i database from an ASP.NET 2.0 (VB) application using OLEDB.
I’m working on tuning and increasing the performance of my IBM DB2 version 9.7
I'm trying to get an IBM tutorialworks example working but until now there hasn't
I am working with an IBM Maximo database that issues workorders automatically. When the
I'm working on data migration from an old IBM Universe-based system to a new
I'm working on a database system and it's indexes, but I'm having a really
I'm working with IBM Rational Application Developer for WebSphere ; it is based on
i was getting this error com.ibm.db2.jcc.b.SqlException: Invalid argument: unknown column name COL1 when trying
I'm currently working on a JSF 1.2 project (IBM implementation and a company layer).
I am trying to create a https connection and its working fine in a

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.