database

MySQL: Does a 'unique' column field imply an index, and if so, why?

Hi all, Although I understand that it is very convinient to have an index on a unique column - to easily and efficiently check for value collision, I think it should be up to the programmer to specify whether a unique field column is to have an index or not, with regards to size- vs speed- optimization. As far as I understand MySQL aut...

Mysql: ERROR 1005 (HY000): Can't create table 'receitascakephp.recipes' (errno: 150)

CREATE TABLE `users` ( `id` INT NOT NULL PRIMARY KEY AUTO_INCREMENT, `name` VARCHAR(255) NOT NULL, `username` VARCHAR(75) NOT NULL, `password` VARCHAR(75) NOT NULL, `image` VARCHAR(255) ); CREATE TABLE `recipes` ( `id` INT NOT NULL PRIMARY KEY AUTO_INCREMENT, `name` VARCHAR(255) NOT NULL, `method` TEXT NOT NULL, ...

How do I automatically compact and repair an Access 2007 database?

I have a site that uses classic ASP and a database in Access 2007 format (.accdb). It is encrypted with a password and is about 300 MiB in file size. The site works fine by itself but every now and then the database gets corrupted (the error is "unrecognized database format"). It can be fixed easily by opening the database in MS Access,...

What is the best way to store a spectrogram graph as a data struture that can be compared against?

I have created a process similar to Shazam that creates a Spectrogram of a given sound clip. I am trying to figure out a way in which to store this data into a database so that I can run comparisons on it. (I dont need actual code, just conceptual help on the process). For those unfamiliar with a spectrogram, its a graph of time on the ...

What is the easiest way to visualize transactional data utilizing using a data dump like MySQL, CSV etc etc

Essentially I want to be able to feed it data and see fancy charts and graphs displaying information out of the data based on x amount of transactions etc etc and/or SQL statements etc. It does not matter if it is client based or web based. Open source would be great but commercial is fine also. Thanks ...

How can I change the default database used in Kohana 3?

I've set up a new database config in application/config/database.php called staff. I've then made a new base model, and added a protected $db variable and set it in the constructor to $this->db = Database::instance('staff'). When I try and replace Db::query(Database::SELECT, $query) with $this->db->query(Database::SELECT, $query), it f...

Database randomly deletes itself every so often

I have a normal SQLite database in my app, managed through my own ContentProvider and implemented via SQLiteOpenHelper. On the Droid only, every few weeks or so, the database just disappears. I have several users who wrote me about that, and I've seen it myself too now. I added some debug info (hard to repro when you only see it every f...

How can I change it to my own database and show my data in ListView.

I can show the list of images out but the the data. I took it from an example online. This is my DBAdapter.java public class DBAdapter { //values for the login table public static final String KEY_ROWID = "_id"; public static final String KEY_USER = "user"; public static final String KEY_PASSWORD = "pass"; public sta...

BACKUP failed to complete the command BACKUP DATABASE

BACKUP failed to complete the command BACKUP DATABASE ... WITH DIFFERENTIAL. Check the backup application log for detailed messages. I see this message in SQL Server log file viewer. Where is the backup application log? ...

load database from text file

say I have a table named XY_values with columns X_values and Y_values. now, I have a text file xy.txt which contains those x values and y values, with x values in the 1st column and y values in the second column. is there any SQL command to load those x and y values from the text file into the XY_values table in the database? thanks. ...

TFS Database Deployment in Sandbox environment

Hi all, I have a Team Solution which includes the database and dataserver projects – these are currently set to compile and create deployment scripts. This can take an age so would probably be worth setting them to build & deploy only when needed. Does anyone have any views on this either way; is there a best practice approach or is ...

Relational database Design- Relationship problem

Hi I need to create database tables to store memo. in the "To" clause user may select individual employee or group of employees (Different groups are already available in database having many to many relationship with employee). i am wondering what should be structure of tables. For simple memo where there are no groups i will have "Memo...

how to design a single methon in DAL to retrieve various result from database?

Hi , we have designed our Data Access Layer and parts of it works as a charm without any problem but we have some doubts about designing a method to get a reference of sqlcommand from us and return a single row data from database also the retrieved data has an unknown data type here is what I've done : //I am using this class as retrie...

MySQL - auto decrementing value

Let's say that I've got a table, like that (id is auto-increment): id | col1 | col2 1 | 'msg'| 'msg' 2 | 'lol'| 'lol2' 3 | 'xxx'| 'x' Now, I want to delete row number 2 and I get something like this id | col1 | col2 1 | 'msg'| 'msg' 3 | 'xxx'| 'x' The thing is, what I want to get is that: id | col1 | col2 1 | 'msg'| 'msg' 2 ...

postgresql: out of shared memory?

I'm running a bunch of queries using Python and psycopg2. I create one large temporary table w/ about 2 million rows, then I get 1000 rows at a time from it by using cur.fetchmany(1000) and run more extensive queries involving those rows. The extensive queries are self-sufficient, though - once they are done, I don't need their results a...

Npgsql: INSERT command does not insert

The Problem: NpgsqlCommand.Text: INSERT INTO mytable (id, name) VALUES (:id, :name) Parameter 1: name=id, value=42 Parameter 2: name=name, value="whatever" command.ExecuteScalar() does not fail, but there is no new row. No duplicate id either. The Code: using (var command = connection.CreateCommand()) { command.Transaction = t...

Yet another many-to-many NHibernate question

hey there Trying to implement relatively simple relationship between User and Role. User can be in many roles, same Role can belong to any number of Users. Roles are shared, i.e. all admin Users refer to the very same instance of class Role. User mapping: <class name="User" lazy="false" table="Users"> <id name="Id" type="int"> ...

How do you manage databases during development?

My development team of four people has been facing this issue for some time now: Sometimes we need to be working off the same set of data. So while we develop on our local computers, the dev database is connected to remotely. However, sometimes we need to run operations on the db that will step on other developers' data, ie we break as...

Implementing database search through query using like

Hi I am planning to implement database search through a website - I know there is full-text search offered by mysql, but turns out that it is not supported for innodb engine (which I need for transaction support). Other options are using sphinx or similar indexing applications. However they require some re factoring of the database str...

Why can't I use "CompactDatabase" in DAO.DBEngine.36 using VBscript?

Hello, I'm trying to make a small VBScript that compacts a MS Access 2007 database file. The code I have is: Set acc2007 = CreateObject("DAO.DBEngine.36") acc2007.CompactDatabase "C:\test.accdb", "C:\test2.accdb", Nothing, Nothing, ";pwd=test" Set acc2007 = Nothing I'm getting this error when I run the three lines with "cscript test.v...