database

What can cause an Oracle ROWID to change?

AFAIK ROWID in Oracle represents physical location of a record in appropriate datafile. In which cases ROWID of a record may change ? The one known to me is UPDATE on partitioned table that "moves" the record to another partition. Are there another cases ? Most of our DBs are Oracle 10. ...

Postgresql: how to create table only if it does not already exist?

I am totally new to postgresql. How can I do a condition to create a table only if it does not already exists? Code example appreciated. ...

Inherited SQL Server Database Problem

I've inherited a SQL Server Database that for some odd reason the developers didn't use Identity to auto increment the primary key. (maybe it was once an Oracle one, who knows). Now,... since the database is accessed from countless clients, I presume that the "next ID" must be stored in the DB somewhere so that they don't conflict with ...

When or why would you use a right outer join instead of left?

I think the title says it all. Wikipedia states: "In practice, explicit right outer joins are rarely used, since they can always be replaced with left outer joins and provide no additional functionality." Can anyone provide a situation where they have preferred to use the RIGHT notation, and why? I can't think of a reason to ever use i...

Document Management

I'm writing a simple document management system for my work. I'm only a hobbyist but have been programming for a while now. My problem is this. When I delete a number of documents through my app, I then need to remove the related database records. What's the best way to go about this without ending up with files with no database records,...

How do I move a Pervasive PSLQ database between servers

What is the easiest way to move a Pervasive PSQL database between two servers. I can stop the database engines if necessary. ...

Checklist towards optimal performance in a database import application

I am facing an application designed to import huge amounts of data into a Microsoft SQL Server 2000 database. The application seems to take an awful long time to complete and I suspect the application design is flawed. Someone asked me to dig into the application to find and fix serious bottlenecks, if any. I would like a structured appr...

Storing an SqlDataReader-object in C#/ASP.NET?

I'm currently writing a C#-class in my ASP.NET (3.5) application to handle all database-queries. Some of the methods are there to make a select-query to the database. Inside the method i simply have a SqlDataReader r = command.ExecuteReader(); to fetch the data. I now want r to be returned by the method, but when i close the database-co...

How do I represent my joins in Relational Algebra?

I am new to relational algebra and for my assignment I have to create two. I have written out the problem I have faced in SQL but I am unsure of how to represent such joins in relational algebra. Any help/pointers would be greatly appreciated. SELECT ps.FirstName AS StudentFirstName, ps.LastName AS StudentLastName, pst.FirstName AS Staf...

Where does Rails store data created by saving activerecord objects during tests?

Where does Rails store data created by saving activerecord objects during tests? I thought I knew the answer to that question: obviously in the _test database. But it looks like this is not true! I used this system to test what's happening to saved ActiveRecord data during rspec tests: $ rails -d mysql test $ cd test $ nano config/d...

CouchDB - .NET or Mono Equivalent Technology

Is there any active "document-based" database projects using .NET or Mono? Something similar to CouchDB, SimpleDB, LotusNotes, etc... Prefer open source. I figure the JScript.NET technology could be used for the Map and Reduce functions over stored JSON documents. ...

Undo in a transactional database

I do not know how to implement undo property of user-friendly interfaces using a transactional database. On one hand it is advisable that the user has multilevel (infinite) undoing possibility as it is stated here in the answer. Patterns that may help in this problem are Memento or Command. However, using a complex database including ...

I've got an existing Django app with a lack of database indexes. Is there a way to automatically generate a list of columns that need indexing?

The beauty of ORM lulled me into a soporific sleep. I was thinking maybe some middleware that logs which columns are involved in WHERE clauses? but is there anything built into MySQL that might help? ...

How do I shrink my SQL Server Database?

I have a Database nearly 1.9Gb Database in size MSDE2000 does not allow DBs that exceed 2.0Gb I need to shrink this DB (and many like it at various client locations) I have found and deleted many 100's of 1000's of records which are considered unneeded. these records account for a large percentage of some of the main (largest) tables i...

How does SQL join work?

I am trying to understand how does joins work internally. What will be the difference between the way in which the following two queries would run? For example (A) Select * FROM TABLE1 FULL JOIN TABLE2 ON TABLE1.ID = TABLE2.ID FULL JOIN TABLE3 ON TABLE1.ID = TABLE3.ID And (B) Select * FROM TABLE1 FULL JOIN TABLE2 ON TABLE1.ID = T...

MySQL design with dynamic number of fields.

My experience with MySQL is very basic. The simple stuff is easy enough, but I ran into something that is going to require a little more knowledge. I have a need for a table that stores a small list of words. The number of words stored could be anywhere between 1 to 15. Later, I plan on searching through the table by these words. I ...

C# - Modifying a Data Table

I have a Data Table that is filled from a database connection. I would like to run checks on the Data Table like replacing the numbers with text and add my own data before binding it to the Data Grid for viewing. How do I access one piece of data in the Data Table? Thanks. ...

Highest Performance Database in Java

I need ideas to implement a (really) high performance in-memory Database/Storage Mechanism in Java. In the range of storing 20,000+ java objects, updated every 5 or so seconds. Some options I am open to: Pure JDBC/database combination JDO JPA/ORM/database combination An Object Database Other Storage Mechanisms What is my best opti...

Database Access Libraries for C++

Background: I have an application written in native C++ which uses the wxWidgets toolkit's wxODBC database access library which is being removed from all future versions of wxWidgets . I need to replace this with another database access method that supports the assumptions and contraints outlined below. I don't require that the replacem...

MySQL Insert: Test first?

As an example, when inserting a record into a table with a unique index, is it best to test first? e.g., $mysqli->query('SELECT email FROM tblUser WHERE email = '[email protected]'); then make sure 0 rows are returned, then do the insert? $mysqli->query('INSERT INTO tblUser ...'); Or is it better to just skip the test and handle the er...