primary-key

ResourceBundle MissingResourceException Linux Specific Key

Hi, I have been having this issue in iterating through an array of keys and calling the getString() method on the resource bundle. I have all the mappings I need in my bundle and for some reason one of the resource will not be fetched. This is only an issue in Linux Ubunthu 9. It works in Windows. It finds all the resources up until my ...

Auto-increment on Azure Table Storage

I am currently developing an application for Azure Table Storage. In that application I have table which will have relatively few inserts (a couple of thousand/day) and the primary key of these entities will be used in another table, which will have billions of rows. Therefore I am looking for a way to use an auto-incremented integer, ...

SQL Alchemy default value function for simulating autoincrement within a unique group of parent-child records

I have a small problem that I think should be easily handled by SQL Alchemy but I can't seem to get it right. I have two tables with one being a parent table and the other a child table. For each child record it needs a unique ID but only with the context of the unique parent record. I am using the Declarative Base approach. I setup ...

About index and primary key in SQL?

It may looks a naive question but I am wondering about the relationship between primary keys and indexes in most common SQL databases. Is it a standard rule for a SQL database to create automatically an index for every primary key? I am asking that because I am designing a model with Django and I am wondering if it is redundant to set...

How to manage non-autoincrement primary key in Rails?

I have lots of situations where I'd like to have a non-autoincrement primary key when using Rails. Example: I have one-to-one relationship between A and B. B describes some specific features added to A thus can't exist without A. So we have: A has one B B belongs to A The natural thinking would be having B.A_id as primary key. So I ...

Should I obscure primary key values?

I'm building a web application where the front end is a highly-specialized search engine. Searching is handled at the main URL, and the user is passed off to a sub-directory when they click on a search result for a more detailed display. This hand-off is being done as a GET request with the primary key being passed in the query string. I...

Composite DB keys with Entity Framework 4.0

Hi, The re-design for a large database at our company makes extensive use of composite primary keys on the database. Forgetting performance impacts, will this cause any difficulties when working with this db in Entity Framework 4.0? The database structure is unlikely to change and I'm not looking for "philosophical" debate but what are...

Why is it necessary to assign atleast one column in a table (in MySQL) as PRIMARY KEY for the table to accept UPDATE and INSERT statements via JDBC?

Also; can I add a negative INT inside a PRIMARY KEY column inside a table via JDBC? ...

Access front-end, SQL Server back-end skipping autonumber IDs

Question title is the crux of the problem. I have an Access 2007 (2003 format) front-end with a SQL Server 2008 Express back-end. The input form has a subform linked to another table. When adding a record in the main form, the PK field of the table (set to auto increment) is skipping about four IDs (I say about because sometimes it's thr...

Inserting a record with specified primary key into MySQL via Entity Framework

Hello, We began using Entity Framework with MySQL in our project recently. Now I am writing unit tests for the data access level; for that purpose I have created a database with some test data. In the test-method for the Delete method I want to first delete a specified record and then insert it again with all the fields holding exactly...

What is the maximum size of a primary key in Firebird?

I need to set a Varchar(255) field as the primary key of a database table in Firebird 2.1. I get error messages saying that the field size is too large. I'm using UTF8 as my character set and the default page size of 4096. Is it possible to do this in Firebird? I need to ensure that this column is unique. ...

Primary key as INT and global key as GUID for improved performance.

Hello. While deciding upon the keys for a table, is it good to have an INT primary key (autoincrement) for the table and a GUID (in addition to the INT) for the scope of the database? Given that there will be more table DML statements it will be faster to operate on INT whereas if any pan-database DMLs statements are to be executed, GUID...

The best choice for Person table primary key

What is your choice for primary key in tables that represent a person (like Client, User, Customer, Employee etc.)? My first choice would be an SSN number. However, using SSN has been discouraged because of privacy concerns and different regulations. SSN can change during person lifetime, so that is another reason against it. I guess th...

Choosing a primary key for many-many relation

I'm trying to model a site similar to StackOverflow. It has a set of users and questions, and user vote on questions. Each user can only have one vote on each question. What should the structure of my "VotesOnQuestions" table look like: Should I have an auto-generated "VoteID" column? How do I disallow, at the schema level, a user fro...

How can I have a primary key in a VIEW (a key that doesn't depend on source tables)

Hello. I'm creating a VIEW out of 3 TABLES. Each TABLE has it's primary key. However, in the VIEW in order to have a primary key, I'll have to use a composite primary key (combination of primary keys of 3 TABLES). I would however like to add a column in the VIEW as a primary key that is created just for the purpose of the VIEW. As par...

Key problem: Which key strategy should I use in my database?

Problem: When I use an auto-incrementing primary key in my database, this happens all the time: I want to store an Order with 10 Items. The ordered Items belong to the Order. So I store the order, ask the database for the last inserted id (which is dangerous when it comes to concurrency, right?), and then store the 10 Items with the for...

Varchar with trailing spaces as a Primary Key in SQL Server 2008

Is it possible to have a varchar column as a primary key with values like 'a ' and 'a', is gives always this error "Violation of PRIMARY KEY constraint" in MS SQL Server 2008. In Oracle dons't give any error. BTW I'm not implementing this way I'm only trying to migrate the data from oracle to sql server. Regards ...

MySQL - Coming up with a Unique Key for each record, not the primary Key

Ok this is a tricky one to explain. I am creating an app that will have PAGES, currently I'm using PageID as the key to SEL the record. The issue I'm having now is that I want users to be able to EDIT pages, but not lose the previous page (for history, recording keeping reasons, like a changelog or wiki page history). This is making m...

Custom PrimaryKey Generation with autoincrement

I need to define and generate primary key for 2 or more tables. Tables hold same type of data but FOR Some BUSINESS RULES we have to make them separate say like TableA = LOCAL_CUSTOMERS TableB = INTERNATIONAL_CUSTOMERS Both hold same columns like, CUSTOMER_ID C_NAME, CITY ....etc While designing the Primary Key I want these keys to b...

Getting Record ID after saving with SubSonic 2.2

Hi, How do I get the Record ID (Primary Key) immediately after saving a record? I have the ID column as auto generated. I need to pass the ID to another object as a "Foreign Key" before saving that object. Currently I do Product.Save() Can't I do int id = Product.Save() ...