database

What are the best practices for storing PHP session data in a database?

I have developed a web application that uses a web server and database hosted by a web host (on the ground) and a server running on Amazon Web Services EC2. Both servers may be used by a user during a session and both will need to know some session information about a user. I don't want to POST the information that is needed by both serv...

Timeout in LINQ to SQL inserting millions of records

I'm inserting approximently 3 million records in a database using this solution. Eventually when the application has been inserting records for a while (my last run lasted around 4 hours), it gives a timeout with the following SqlException: "SqlExcepetion: Timeout expired. The timeoutperiod elapsed prior to completion of the operatio...

Get column of a mysql entry

Is there a possibility to get the name of the column a database entry belongs to? Perhaps I have three columns with column names col1, col2 and col3. Now I want to select for every column the column with the maximum entry, something like this. Select name_of_column(max(col1,col2,col3)). I know that I can ask for the name of the colum...

What are the factors in choosing a specific Database Management System?

Why are there so many Database management systems? I am not an DB expert and I've never thought about using another Database other than mySQL. Programming languages offer different paradigms, so it makes sense to choose a specific language for your purpose. Question What are the factors in choosing a specific Database management syste...

How to read data from database into powerpoint slides?

Hi, I want to know how to read data from database (ANY KIND) and present it via power point slides show? Thanks, ...

4GB limitation on these embedded/express DBs good enough? what's next if limitation is reached?

I'm wondering how long a (theoretically) desktop-app can consume the full 4GB limitation of these express/embedded database products (SQL-Server Express, Oracle Express, SQLite3, etc) provided that big blobs will be stored in filesystem. Also what would be your strategy when it hits the 4GB? Archive the old DB Copy 1-3 months of data...

Deleting certain rows based on the count of a column in the mysql database

Hi, I have a very large database with about 120 Million records in one table.I have clean up the data in this table first before I divide it into several tables(possibly normalizing it). The columns of this table is as follows: "id(Primary Key), userId, Url, Tag " . This is basically a subset of the dataset from delicious website. As I s...

Best Practices for working with files via c#

Application I work on generates several hundreds of files (csv) in a 15 minutes period of times. and the back end of the application takes these files and process them (updates database with those values). One problem is database locks. What are the best practices on working with several thousands of files to avoid locking and efficient...

Foreign key on a child table dependant on parent field

Using SQL2005/2008. Let's say I have a Hotel table (HotelID, HotelName) and a Room table (RoomID, HotelID, RoomName) Hotel -> Room 1:M by HotelID RoomID is PK inside Room Now I have a Contract table (ContractID, HotelID, ContractDescription) and ContractRate (ContractRateID, ContractID, RoomID, Rate) All primaries and foreign key...

Django models: Use multiple values as a key?

Here is a simple model: class TakingCourse(models.Model): course = models.ForeignKey(Course) term = models.ForeignKey(Term) Instead of Django creating a default primary key, I would like to use both course and term as the primary key - taken together, they uniquely identify a tuple. Is this allowed by Django? On a related not...

How to prepare Cyrilic and other variables for storing into MySql DB? (PHP)

How to prepare Cyrilic and other variables for storing into MySql DB? (PHP) So I need realy simple way to prepare recived from browser $_GET[string] variables for storing into DB. How to do such thing? ...

[H2 and Firebird]auto_increment, identity or trigger plus generator?

Hi all, in Firebird the only way to have an auto increment coloumn is to setup a generator and use it with a trigger. In H2 db there are auto_increment and identity keywords to do it. What is the best way? Mysql use auto_increment too, but there is some problems with cuncurrence read and table lock, isn't true? Thank you. ...

MySQL query does not return any data

Hi, I need to retrieve data from a specific time period. The query works fine until I specify the time period. Is there something wrong with the way I specify time period? I know there are many entries within that time-frame. This query returns empty: SELECT stop_times.stop_id, STR_TO_DATE(stop_times.arrival_time, '%H:%i:%s') as stop...

Surgical slave reads for Ruby on Rails, mulitple databases.

Greetings, I'm currently working on a multiple database rails application. I want to off load the SELECT queries on to the slave databases for only SOME of the databases or specific models. The issue is that in places, we swap out the current database connection and put in a different one for a short time; to load fixtures or to hand...

How do I change mysql settings so that it is default UTF-8 for everything?

I am getting "ASCII encoding" errors when I insert into my database because I did a fresh install of the MYSQL. I'd like to change the default to UTF-8 again. This is the error I'm getting because MYSQL is not set in UTF-8 mode: UnicodeEncodeError: 'ascii' codec can't encode characters in position 0-1: ordinal not in range(128) ...

[H2 database] Frontends tool to manage H2 database

Hi all, what's the best frontend tool to manage H2 database? Create table, alter table, add coloumn ecc ecc.. Thanks. ...

Rails show latest entry

Hi Everyone, I have a working Rails application on version 2.3.5 - I am using many to many model relations and have got almost everything working. What I would like to do is on my new kase page show the most recent kase job ref at the top. So for example, if I created a new kase with a job ref of "001", if I then went to create a new...

using haskell for "business applications"

Hello, I would like to know if there is any posiibility that I can use Haskell with small database like sql server compact so that client wont have to install any server on his desktop. Is there any api providing sql statements and so on ... What is the best solution to achieve small database application using haskell. thanks for help...

SELECT USING COUNT in mysql

Hi, I have a very large database with about 120 Million records in one table.I have clean up the data in this table first before I divide it into several tables(possibly normalizing it). The columns of this table is as follows: "id(Primary Key), userId, Url, Tag " . This is basically a subset of the dataset from delicious website. As I s...

Need to work out database structure

Hi, Just need a little kickstart with this. I have Mysql/PHP, and I have 5,000 products. I have 30 companies I need to store some data for those 30 companies for each product as follows: a) prices b) stock qty I also need to store data historically on a daily basis. So the table... It makes sense that the records will be the ...