database

Managing the migration of breaking database changes to a database shared by old version of the same application

One of my goals is to be able to deploy a new version of a web application that runs side by side the old version. The catch is that everything shares a database. A database that in the new version tends to include significant refactoring to database tables. I would like to be rollout the new version of the application to users over ti...

Exporting UTF8 data from db2

I have a db2 table that contains values in many languages (including right-to-left languages.) When I export this table on a linux box using cli's ''export'' command, I get a good looking comma delimited text file (DEL file,) but when I try it on aix, it replaces all characters that are not in ascii with 0x1a. I tried playing around wi...

Best practices for storing database passwords

I have a database that many different client applications (a smattering of web services, some java apps and a few dot net applications) connect to. Not all of these are running on windows (Sadly, otherwise it would make this an easy answer question with just enabling windows authentication for database connections). At the moment, the pa...

What is your recommendation for a good SQL IDE?

What is the best SQL IDE you have used? ...

Page View Counter - Database Setup and Technique/Strategy

I am developing a page view counter to track the amount of views a page is having on our site and displaying it to the user. (I asked an intro question before: http://stackoverflow.com/questions/246919/page-view-counter-like-on-stackoverflow). Using the recommendations, I developed a httpHandler which will handle the request whenever th...

How to attach HTML file to email using content taken from DB in PHP?

Hi, How do I send mail via PHP with attachment of HTML file? -> Content of HTML file (code) is in string in DB. Is there some easy way or free script to do this? I don't want to store the file localy, I need to read it out of DB and send it straightaway as attachment (not included in body). ...

What best practices do you use for testing database queries?

I'm currently in the process of testing our solution that has the whole "gamut" of layers: UI, Middle, and the omnipresent Database. Before my arrival on my current team, query testing was done by the testers manually crafting queries that would theoretically return a result set that the stored procedure should return based on various r...

Searching across shards?

Short version If I split my users into shards, how do I offer a "user search"? Obviously, I don't want every search to hit every shard. Long version By shard, I mean have multiple databases where each contains a fraction of the total data. For (a naive) example, the databases UserA, UserB, etc. might contain users whose names begin ...

Is there an easy way to clone the structure of a table in Oracle?

If I have a table like: CREATE TABLE FRED ( recordId number(18) primary key, firstName varchar2(50) ); Is there an easy way to clone it's structure (not it's data) into another table of a given name. Basically I want to create table with exactly the same structure, but a different name, so that I can perform some functionality on it. ...

notification when alter occurs on oracle database

We have a database that many persons have to have access to. I am looking for a way that will allow us to get notification whenever "alter" occurs on this database, so other parties can be aware of it. Please advise. ...

How do I compress this Oracle resultset into values according to row priority, ignoring nulls?

I'll simplify the problem as much as possible: I have an oracle table: row_priority, col1, col2, col3 0, .1, 100, {null} 12, {null}, {null}, 3 24, .2, {null}, {null} Desired result: col1, col2, col3 .2, 100, 3 So according to the priority of the row, it overrides previous row values, if given. I'm attempting to work out a solutio...

Content Voting Database and Application Design

How would you design a content voting mechanism that could be applied polymorphically to multiple models / classes. (in a ruby on rails context preferably, but others are fine) Given that instances of these classes can be voted on: - Article - Question - Product Voters should not be required to register. Best effort should be made to ...

Database Design regarding Dynamic entries - One row, or multiple rows?

I've been trying to design a database schema for a side project but I havent been able to produce anything that I'm comfortable with. I'm using ASP.Net with LINQ for my data access: I'm going to allow users to specify up to 10 "items" each with 2 numeric properties, and 1 referential property, the item name. If I were to put this entry...

Does SQL Server 2005 have an equivalent to MySql's ENUM data type?

I'm working on a project and I want to store some easily enumerated information in a table. MySql's enum data type does exactly what I want: http://dev.mysql.com/doc/refman/5.0/en/enum.html . Is there an equivalent in SQL Server 2005? I know I could store the possible values in a type table with a key, but I'd rather not have to link ...

MySQL data modeling.

I have this current problem with data i have to represent in a MySQL database: I have to support different kinds of products with different data each one, for example, cars, hotel rooms, books, etc. For my application there is some data which is common for each product, like name, description, price, etc. So I think of having a produc...

Is there a speed difference between sqlite3 and mysql?

After much googling I have been wondering what the benefits/differences are between mysql and sqlite3. I am primarily hoping for a speed bump when moving my development database to my production database, although I imagine this will primarily happen in my code. Does any know what the major differences are in performance? ARE there? Or w...

Why would LIKE be faster than =?

A co-worker recently ran into a situation where a query to look up security permissions was taking ~15 seconds to run using an = comparison on UserID (which is a UNIQUEIDENTIFIER). Needless to say, the users were less than impressed. Out of frustration, my co-worker changed the = comparison to use a LIKE and the query sped up to under 1...

Connection pooling in hsqldb

What is the best way to implement connection pooling in hsqldb, without compromising on the speed? ...

What is your opinion of nPersist?

It's a candidate to be used for our project so if anyone has used it any opinion will be appreciated. ...

How do I turn SQL logging on in Postgres 8.2?

I've got the following settings in my postgres conf: log_destination = 'stderr' redirect_stderr = on log_directory = '/tmp/psqlog' log_statement = 'all' And yet no logs are logged. What am I missing here? There is reference on the internet to a variable called "logging_collector", but when I try and set that, postgres dies on startu...