database

How to do fuzzy string search without a heavy database?

I have a mapping of catalog numbers to product names: 35 cozy comforter 35 warm blanket 67 pillow and need a search that would find misspelled, mixed names like "warm cmfrter". We have code using edit-distance (difflib), but it probably won't scale to the 18000 names. I achieved something similar with Lucene, but as PyLucene only...

I change a value in my application , but don't update in my database

hello. I write this code in my project but when I change a value in my application,appeared a exception and don't update my database,this code work for new but dont work for delete and edit data. CODE : private void btnLecOk_Click(object sender, EventArgs e) { DataRow dr = (lecturesBindingSource.Current as DataRowView)...

Mapping a database table to an attribute of an object

I've come across a place in my current project where I have created several classes for storing a complicated data structure in memory and a completed SQL schema for storing the same data in a database. I've decided to use SQLAlchemy as an ORM layer as it seems the most flexible solution that I can tailor to my needs. My problem is tha...

A Security (encryption) Dilemma

I have an internal WPF client application that accesses a database. The application is a central resource for a Support team and as such includes Remote Access/Login information for clients. At the moment this database is not available via a web interface etc, but one day is likely to. The remote access information includes the usernam...

simple remote ODBC database connection with ruby

I am attempting to make a simple connection to a remote database. I can not seem to get it to work. remote_db = DBI.connect('DBI:ODBC:remote-host','user','password') remote_db.table { |table| pp table } Any help would be greatly appreciated. ...

How to creata database Schema using Hibernate

After reading Hibernate: hbm2ddl.auto=update in production? some questions arose. First of all, the reason for I'm using Hibernate is to be database vendor independent (no need to write 10 versions of the "same" sql query, eg. tsql vs. sql). My problem appears when it's time to create the database schemas (production environment). As f...

How to search and replace all instances of a string within a database?

Hey everyone, I have a string that is contained inside of a wordpress install (the name of a server) thousands of times, across multiple columns, records and tables. I'd like to update it with the location of another server - we are moving the content over. So the source would be something like http://my-server1/some/link/to/something...

What's the best way to store/calculate user scores?

I am looking to design a database for a website where users will be able to gain points (reputation) for performing certain activities and am struggling with the database design. I am planning to keep records of the things a user does so they may have 25 points for an item they have submitted, 1 point each for 30 comments they have made...

First was RDO, later ADO and more later ADO.NET, now LINQ. ¿Is LINQ the next standard or I should wait?

In my humble opinion, Microsoft is changing rules about database managing each four or five years. I remember old days when RDO was the solution to connect to SQL server. I refresh my knowledge to use ADO because RDO was obsolete. ADO was very good and effective, but not so long ago, I found myself programming and refreshing again my kno...

Useful databases around web

As Tim Berners-Lee told at TED, there's lots of hidden data. What useful free databases or APIs you know around web? For example: European Union's VAT number validator Team Cymru's IP Address to ASN/country mapping PhishTank API against phishing Akismet against spam (free for personal use) IMDB database dumps Wikipedia database dumps U...

Scaling with a cluster- best strategy

I am thinking about the best strategy to scale with a cluster of servers. I know there is no hard and fast rules, but I am curious what people think about these scenarios: cluster of combination app/db servers that are round robin (with failover) balanced using dnsmadeeasy. the db's are synced using replication. Has the advantage tha...

Could someone please explain LDAP?

I often hear things like "Can we load our employee info using LDAP?" Yet, the title "Lightweight Directory Access Protocol" makes me think of it as a protocol rather than a physical database management system like Oracle or MSSQL. So could someone please explain to me what LDAP is, how it's used, and how it basically works? Is LDAP si...

Problems with database relations with symfony framework - Cannot fetch TableMap for undefined table

Hello, Currently developing an application using the newest version of symfony, obtained through PEAR. This is my exact schema configuration propel: user: id: name: { type: varchar(255), required: true } level: { type: integer, required: true, default: 1 } created_at: post: id: title: { type: varchar(255)...

How to check if mysql database exists

Is it possible to check if a (MySQL) database exists after having made a connection. I know how to check if a table exists in a DB, but I need to check if the DB exists. If not I have to call another piece of code to create it and populate it. I know this all sounds somewhat inelegant - this is a quick and dirty app. ...

cursor.rowcount always -1 in sqlite3 in python3k

Hi, I am trying to get the rowcount of a sqlite3 cursor in my Python3k program, but I am puzzled, as the rowcount is always -1, despite what python3 docs say (actually it is contradictory, it should be None). Even after fetching all the rows, rowcount stays at -1. Is it a Sqlite3 implementation bug? A Sqlite3 bug? I have already checked ...

How to create a schema where there can be multiple user-defined attributes per customer?

I'm going to be working on an application that allows our client to define fields that will be shown to users in sort of a feedback/survey environment. For example, a pizzeria might have a field asking for your favorite topping, a bar might have your favorite brand of beer. The system needs to be able to handle letting our customers cr...

SQL query to extract text from a column and store it to a different column in the same record.

I need some help with a SQL query... I have a SQL table that holds in a column details of a form that has been submitted. I need to get a part of the text that is stored in that column and put it into a different column on the same row. The bit of text that I need to copy is always in the same position in the column. Any help would b...

Should each and every table have a primary key?

I'm creating a database table and I don't have a logical primary key assigned to it. So, I'm thinking about leaving it without a primary key, but I'm felling a bit guiltly about it. Should I? Should each and every table have a primary key? EDIT: Okay, okay... I've created the primary key! Are you happy now? :) ...

Does a table with a surrogate key require a unique constraint on a natural key to be in 1NF?

The pragmatists have won the argument of surrogate vs. natural primary keys in favor of surrogate keys*. In my own work I always use SQL Server identity columns without a second thought. But it occurs to me that, for a table to be in 1st normal form, I should be able to identify a natural key and enforce it with a unique constraint. I ca...

Tracing the time when a value was updated in a table

Hi Friends, Can anybody please, let me know if there is a way to find out the exact time, when a table was updated.I mean when a column was updated. Please, help. Thanks, ...