database

How would I go about creating a new MySQL table with the results of "myisam_ftdump -c"?

I'm using myisam_ftdump -c to dump the occurrences of words in my fulltext column. What's the simplest way to insert that information into a new MySQL table? Thanks for any help, it's appreciated. ...

Someone tell me why my database design is stupid, and how I can fix it

So I have these vehicles, many different types of them. Every type has its own table, with many attributes. Then I have a "vehicles" table, which holds the ids and types of all the vehicles in every table. Vehicles can have photos, so I have a "photos" table, with a vehicle_id, linking the photo to the vehicle it belongs to. Now every v...

Auto generation of META tags in PHP

I was thinking of writing a PHP script that would analyse a CMS'd page's content (i.e. database field) and then auto-generate (X)HTML META description & keyword tags, but as always there's no point reinventing the wheel so I'm wondering if anyone knows of such a beastie? The former I imagine would be something like a relatively straight...

Add Rows on Migrations

Hi! I'd like to know which is the preferred way to add records to a database table in a Rails Migration. I've read on Ola Bini's book (Jruby on Rails) that he does something like this: class CreateProductCategories < ActiveRecord::Migration #defines the AR class class ProductType < ActiveRecord::Base; end def self.up #CREAT...

SQL query statement to retrieve records having CLOB data from the oracle database.

I tried this code and the value of comments from final table having a clob datatype is null or sometimes displays few words. What should I add so that I retrieve the whole data from comments and displays to the textarea? Thanks:-) <%@ page import="java.sql.*" %> <% Class.forName("oracle.jdbc.driver.OracleDriver"); %> <HTML> <TIT...

a question about sql group by

I have a table named visiting that looks like this: id | visitor_id | visit_time ------------------------------------- 1 | 1 | 2009-01-06 08:45:02 2 | 1 | 2009-01-06 08:58:11 3 | 1 | 2009-01-06 09:08:23 4 | 1 | 2009-01-06 21:55:23 5 | 1 | 2009-01-06 22:03:35 I want to work out a sql...

URLs: Binary Blob, Unicode or Encoded Unicode String?

I wish to store URLs in a database (MySQL in this case) and process it in Python. Though the database and programming language are probably not this relevant to my question. In my setup I receive unicode strings when querying a text field in the database. But is a URL actually text? Is encoding from and decoding to unicode an operation...

What are my options to store and query huge amounts of data where a lot of it is repeating ?

I am evaluating options for efficient data storage in Java. The data set is time stamped data values with a named primary key. e.g. Name: A|B|C:D Value: 124 TimeStamp: 01/06/2009 08:24:39,223 Could be a stock price at a given point in time, so it is, I suppose, a classic time series data pattern. However, I really need a generic RDBMS...

Problem with SQL Join

I have two tables, tblEntities and tblScheduling. tblEntities: EntityID ShortName Active 1 Dirtville 1 2 Goldtown 1 3 Blackston 0 4 Cornfelt 1 5 Vick 1 tblScheduling: ScheduleID EntityID SchedulingYearID 1 1 20 2 ...

SQLite 3 C API Transactions

I am using SQLite3 for iPhone development and I'm attempting to wrap a few insert statements into a transaction. Currently I have the below code which is working properly however after reading another question on SO I realized it would be better to have these in one transaction rather than one each. I couldn't find the C API call to begi...

Modelling inheritance in a database.

Hi Everyone, For a database assignment I have to model a system for a school. Part of the requirements is to model information for staff, students and parents. In the UML class diagram I have modelled this as those three classes being subtypes of a person type. This is because they will all require information on, among other things...

What is the difference between a temporary table vs global temporary table in Oracle?

I have heard these two terms "temporary table" and "global temporary table" used pretty much in similar context. What is the difference between the two? ...

Ideas on this alternative to ORM + RDBMS?

I am currently developing a proof of concept for an alternative data store. The reason why is I need to enhance a read-mostly clustered webapp, but also because I want to free myself from the pain of the sometimes overly-complex ORM+RDBMS solution. Overall the idea is quite similar to a distributed cache with persistence (letting the cl...

Is my Relational Algebra correct?

I have a database assignment which i have to create some relational algebra for two problems. I feel fairly all right with the majority of it, but I just get confused when trying to project attributes out of a table which is joined to another table. for example is this correct? Q1) List the details of incidences with no calls made, so ...

MySQL partitioning with ActiveRecord

I want to take advantage of the new partitioning in MySQL 5.1 but using a standard ActiveRecord model. The problem I have encountered is that to use the partitioning the primary key on the table must include the columns used in the partitioning function. (http://dev.mysql.com/doc/refman/5.1/en/partitioning-limitations-partitioning-keys...

How can I identify unused/redundant columns given a list of tables?

[This is on an iSeries/DB2 database if that makes any difference] I want to write a procedure to identify columns that are left as blank or zero (given a list of tables). Assuming I can pull out table and column definitions from the central system tables, how should I check the above condition? My first guess is for each column generat...

How can I export data in a legacy DOS application when no export option is available?

We've been given the task by my customer to export data from a legacy DOS system, using a RAIMA database, so it can be imported into a new system we are writing for them. It looks like the data is stored in a flat file format, though when we open the files most of the text is gibberish. We do see Raima Database Manager along the top ...

How can I auto-backup a SQL Server Express database?

I've deployed MS Sql Server Express edition on a server with a database that's updated daily. It is important that I have regular backups of the database, preferably daily. But I can't hope to do this manually everyday. How can I have auto-backups of my databases on that server? A system that will preferably upload these databases to a F...

SSIS Transfer Task That Handles Schema Changes

I'm using SSIS with SQL Server 2k5 to build a transfer task to copy all of the data from one database to another. This works quite well, except for one problem - the source database will periodically have schema changes (generally just additions like new columns) but the transfer task seems to choke if the two schemas don't match exactly...

Should I combine two similar tables into one?

In my database I currently have two tables that are almost identical except for one field. For a quick explanation, with my project, each year businesses submit to me a list of suppliers that they sale to, and also purchase things from. Since this is done on an annual basis, I have a table called "sales" and one called "purchases". ...