database

Best way to test for duplicate keys in a database

This is more of a correctness question. Say I have a table with a primary key column in my database. In my DAO code I have a function called insertRow(string key) that will return true if the key doesn't exist in the table and insert a new row with the key. Otherwise, if a row already exists with that key it returns false. Is it better/...

Is there any way to use LINQ for MDX queries?

Anyone know if there are plans for LINQ to MDX . Does any way currently exist to use LINQ with MDX / CUBES ...

Design Patterns for Interfacing with Relational Databases?

Does anyone know of any design patterns for interfacing with relational databases? For instance, is it better to have SQL inline in your methods, or instantiate a SQL object where you pass data in and it builds the SQL statements? Do you have a static method to return the connection string and each method just gets that string and conn...

Large Sqlite database search

How is it possible to implement an efficient large Sqlite db search (more than 90000 entries)? I'm using Python and SQLObject ORM: import re ... def search1(): cr = re.compile(ur'foo') for item in Item.select(): if cr.search(item.name) or cr.search(item.skim): print item.name T...

String or Enum

Which situation is better? Assuming upwards of 300 possible values on what would essentially be a table of key/value pairs where the column in question is the key: Enum or Char/Varchar I'm just wondering if anyone has dealt with an Enum column with that many possible values and what the pitfalls might be. EDIT: Keys ARE predefined. ...

Is Anyone Still Using Access For Web Development Anymore?

Yes, I know, you are all cringing in horror. Back in the day I got my start writing internal apps with classic ASP and MS Access. I'm writing a small marketing app, and I recently got denied access to our SQL Server. So I was looking for alternatives. There will be very little data input, mostly just reading static data. I've heard ...

Fastest way to lookup keywords. Any language, any system.

Daily I have 5 million or so unique keywords with an impression count for each one. I want to be able to look these keywords up by certain words so for instance if I have "ipod nano 4GB" I want to be able to pull that out if I search for "ipod", "nano", or "4GB". mySQL can't seem to handle that much data for what I want, I've tried Ber...

How to order find results on value from either of 2 columns? (which ones depends) (Rails)

Hi, Total noob question. Would greatly appreciate any pointers. I have a rails model that includes 2 possible values for a concept, e.g., distance (a value from a GPS file and an edited value). It's possible to have a value in either column (just file or just manual), both (manual overwrites file in this case), or neither: distance-f...

Usable view for dumb users?

I'm working on a small project that requires some of our users to be able to view/sort/filter and generally play around with a large amount of data. It's based on a sql server 2000 view and is something on the order of 125k rows worth of historical event data (think sports). Normally I would turn to excel for this kind of simple manipu...

Obtain id of an insert in the same statement

Hello Is there any way of insert a row in a table and get the new generated ID, in only one statement? I want to use JDBC, and the ID will be generated by a sequence or will be an autoincrement field. Thanks for your help. John Pollancre ...

Is Google's Fusion Tables really a "paradigm shift?"

Boy, there's a lot of hype about the release of Google's Fusion Tables. The collaborative editing is something that seems fantastic, and might interface well with Google Wave. The visualization seems to shine mostly in it's ease of use. Aggregation over multiple disparate data sources is also just a really great and timely idea. Stil...

How does DB clustering work?

Hello I have a question for the DBA's out there: If I scale from a single web/DB server setup to two web/two DB server setup with a load balancer in front of the web servers to route incoming queries evenly... how do solutions like MySQL Cluster work so that a change made to one DB server is immediately known to the other (otherwise, us...

Writing unit test for persistent data creation and deletion

When writing a test for persistently stored data, I come up with a test along the lines of: [TestMethod] public void DoCreateDeleteTest() { PersistentDataStore pds = new PersistentDataStore(); bool createSuccess = pds.Save("id", "payload"); Assert.AreEqual(true, createSuccess); bool deleteSuccess = pds.Delete("id"); ...

Script to copy data from one Informix database to another

Hi, I have a need to copy data from one Informix database to another. I do not want to use LOAD for doing this. Is there any script that can help me with this? Is there any other way to do this? Thanks in advance! Ravilla ...

Are circular references acceptable in database?

When are circular references acceptable in database? Theoretical and practical, any help is appreciated. ...

Altering a SQL Server table without impact

I have a table with some 30 columns, already used in the application extensively. i.e Select, Insert and Update operations for this table written in many different ways(in whatever ways the developers thought they were comfortable) in number of stored procedures and UDFs. I'm now handed with a task to extend the functionality for which t...

PostgreSQL -> Oracle replication

I'm looking for a tool to export data from a PostgreSQL DB to an Oracle data warehouse. I'm really looking for a heterogenous DB replication tool, rather than an export->convert->import solution. Continuent Tungsten Replicator looks like it would do the job, but PostgreSQL support won't be ready for another couple months. Are there an...

EMR (Electronic Medical Record) standard record format?

Hi - A few associates and myself are starting an EMR project (Electronic Medical Records). I have heard talk in the past - and more so lately - about a standard record format - to facilitate the transferring of records when appropriate (HIPAA) from one facility to another. Has anyone seen any information on this? Much appreciated, Jim ...

Which database should I use for my desktop application?

I have a commercial Windows desktop application that needs a backend database. I feel that SQL Server would not be the right choice as it is overkill. What would you recommend and how would you deploy it? ...

how to emulate "insert ignore" and "on duplicate key update" (sql merge) with postgresql ?

what's the best way to emulate "insert ignore" and "on duplicate key update" with postgresql ? ...