database

How to design DB table / schema with ease?

Is there a simple method to decide on what fields and indexes are needed for each table in an app you design? For example, if it is a webapp that simply lets people create lists (any number of lists, and users can create "things to do" list or "shopping" list), and the user can assign other users to edit the list, and whether the list i...

postgresql libpq inserting empty row for no reason

I'm using the libpq library in C for accessing my Postgresql database. The application inserts a piece of data fed from a queue. When there is a lot of data and it's inserting very quickly it randomly inserts and empty row into the table. Before I even perform the insert I check to make sure that the length of the text being inserted is ...

python orm

This is a newbie theory question - I'm just starting to use Python and looking into Django and orm. Question: If I develop my objects and through additional development modify the base object structures, inheritance, etc. - would Django's ORM solution modify the database automatically OR do I need to perform a conversion (if the app is ...

Hyphens in column names in MySQL DB

May be this question has been answered before but I couldn't find it. I am using a 2/3 yr old MySQL database which has hyphens in its column names. When I try to use these names from my Java code, the names are broken at the hyphen (e.g. air_port becomes air) and thus are not found. I tried replacing hyphens to underscores in my code ho...

What is the least resource intense data structure to distribute with a Python Application

I am building an application to distribute to fellow academics. The application will take three parameters that the user submits and output a list of dates and codes related to those events. I have been building this using a dictionary and intended to build the application so that the dictionary loaded from a pickle file when the appli...

How do I select all the rows where a varchar field contains non-digit characters?

I want to find all instances in a table where a string field cannot be cast as a number. Is there a way to do like a "try" in t-sql so that I can get all the id's where the cast failed and delete the value? ...

comparing data from mysql backups

I've got a few backups of my database, and I'm trying to figure out if there is a way to compare the data in the backups to see how the data as changed over time. I do not have a timestamp on the fields I want to compare, but I do have a unique id on the row. The backups are .sql files created by using mysqldump. Is there a process fo...

possible type of database that uses dat, idx files

i have an application that was written in delphi it is fairly recent, running on win32 i want to hook into the database with odbc but i am unsure which database driver to use the directory with the database has .dat .idx files for each table it is a standalone database not client server (as far as i can tell) any ideas what type of dat...

What causes this error in my PHP SQL query?

I'm having a problem with my mysql php code. The code is meant to search the data base with variables inputted by the user and bring up the corresponding results. For example if I searched for only colour photos only colour photos would be listed with the name of the artist, size etc. But I am getting an error message and I don't underst...

DB (SQL) automated stress/load tools?

I want to measure the performance and scalability of my DB application. I am looking for a tool that would allow me to run many SQL statements against my DB, taking the DB and script (SQL) file as arguments (+necessary details, e.g. host name, port, login...). Ideally it should let me control parameters such as number of simulated clien...

Does dropping a table in MySQL also drop the indexes?

It's not explicitly mentioned in the documentation (http://dev.mysql.com/doc/refman/6.0/en/drop-table.html). I ask because I just saw a curious database migration in a Rails project where the developer was removing all the indexes before dropping the table, and that seemed unnecessary. ...

any formal benchmarking of Open source Database software ?

Hi, Is there any formal performance and stress test reports of open source database, specially sqlite,MySQL an PgSQL? I want to use sqlite in server for its simple structure and easy embeddable capability. But I can not find any pros and cons (by Googling and Yahoo!ing) regarding performance of these database software. Please suggest....

Sybase stored proc called from isql on AIX: how to handle return code

I've got an AIX batch job that uses isql to execute a stored procedure in Sybase. The stored procedure is returning an error code under certain conditions. I would like for isql to pass that return code to the AIX script. Can I capture the the stored proc's return code within isql, or do I have to write an output file of some kind and h...

Updating textfield in doctrine produces an exception

I have a textfield that contains say for example the following text:- "A traditional English dish comprising sausages in Yorkshire pudding batter, usually served with vegetables and gravy." This textfield is in a form that simply updates an item record using it's ID. If I edit part of the textfield and replace "and gravy." with "humous...

What's more costly on every page view - Database Writes or File Writes?

What is the most efficient solution when you need to record some data on every page view in your application - should you write to a file or write to the database? Or maybe neither - perhaps you should cache the data in memory or a file and only write it to the database (or file system if you use a memory cache) occasionally? ...

How to cancel a long-running Database operation?

Currently working with Oracle, but will also need a solution for MS SQL. I have a GUI that allows users to generate SQL that will be executed on the database. This can take a very long time, depending on the search they generate. I want the GUI/App to responsive during this search and I want the user to be able to cancel the search. ...

Language/Framework support for Interacting With CouchDB

I am interested in knowing if there are any server-side web application frameworks which integrate nicely with CouchDB? Does anyone have any experience in doing this? It seems like a dynamic language would be well-suited for playing with the JSON, but I am more interested in hearing about how it would fit in with the framework and the ap...

Relational & Object-Oriented Database which one is better, will be suppressed?

I wonder if RDBMS or OODBMS will be suppressed in near future? Today I read quite a few articles about differences in both of them and most of the articles seem to favor OODBMS. Does that mean that RDBMS will be suppressed by, not yet well developed, OODBMS? If not, what makes you think so? ...

Modeling atomic facts in a relational database

I want to record what various sources have to say about a historical figure. i.e. The website Wikipedia says that Susan B. Anthony was born February 15, 1820 and her favorite color was blue The book Century of Struggle says that Susan B. Anthony was born on February 12, 1820 and her favorite color was red The book History of Woman's S...

How to COUNT rows within EntityFramework without loading contents?

I'm trying to determine how to count the matching rows on a table using the EntityFramework. The problem is that each row might have many megabytes of data (in a Binary field). Of course the SQL would be something like this: SELECT COUNT(*) FROM [MyTable] WHERE [fkID] = '1'; I could load all of the rows and then find the Count with:...