database

How to do database schema migrations in Android?

Is there a standard way to do database schema migrations on Android? For example, user installs newer version of my Android app but the new version needs to make updates to the database schema (and wiping the user's database and starting over is not an option!). So I need to run some ALTER statements and/or copy tables the first time my ...

SQLite3's dynamic typing

SQLite3 uses dynamic typing rather than static typing, in contrast to other flavors of SQL. The SQLite website reads: Most SQL database engines (every SQL database engine other than SQLite, as far as we know) uses static, rigid typing. With static typing, the datatype of a value is determined by its container - the particular column...

Connecting to two databases

Hi, I have an application in which I want to authenticate a user from a first database & manage other activities from another database. I have created two classes. An object of the classes is defined in a file: $objdb1=new db1(),$objdb2=new db2(); But when I try to call $objdb1->fn(). It searches from the $objdb2 & is showing table1 ...

Import Paradox table in Access database: Incorrect collating sequence

Hello, I have a Paradox 5.0 database and want to migrate it to Access 2007. But if I try to import a Paradox table, Access gives an error message: "Incorrect collating sequence". The Help says: "You tried to link a Paradox table that was created with an international sort order that is not the same as the one you are using". What am I...

mysql query to get unique value from one column

i have a table named locations of which i want to select and get values in such a way that it should select only distinct values from a column but select all other values . table name: locations column names 1: country values : America, India, India, India column names 2: state/Province : Newyork, Punjab, Karnataka, kerala when i selec...

Source Controlled Database Data import strategies.

So I've gotten a project and got the db team sold on source control for the db (weird right?) anyway, the db already exists, it is massive, and the application is very dependent on the data. The developers need up to three different flavors of the data to work against when writing SPROCs and so on. Obviously I could script out data inse...

How to read a database record with a DataReader and add it to a DataTable

Hello I have some data in a Oracle database table(around 4 million records) which i want to transform and store in a MSSQL database using ADO.NET. So far i used (for much smaller tables) a DataAdapter to read the data out of the Oracle DataBase and add the DataTable to a DataSet for further processing. When i tried this with my huge t...

What is best practice with SQLite and Android ?

What is considered "best practice" when executing queries on a SQLite db within an Android app? Is it safe to run inserts, deletes and select queries from an AsyncTask's doInBackground ? Or should I use the UI Thread ? I suppose that db queries can be "heavy" and should not use the UI thread as it can lock up the app - resulting in an A...

Detecting changes between rows with same ID

I have a table containing some names and their associated ID, along with a snapshot: snapshot, systemid, name[, some, other, columns] I need to identify all the unique names that a systemid has had across all snapshots, but only where there has been at least once change. For example, with the data: 'DR1', 0, 'MOUSE_SPEED' 'DR1', 1, ...

How to implement a "check for updates" routine for iPhone app that will download a replacement SQLite DB?

My app has a SQLite database that users can read only. I, the developer, would like to add entries to the database from time to time and make the enlarged database available as a file on a Web server. I'd like the users to be able to "check for updates". My question is, once a user checks and finds that an updated DB file exists, how ca...

Must all Concurrent Data Store (CDB) locks be explicitly released when closing a Berkeley DB?

I have an application that comprises multiple processes each accessing a single Berkeley DB Concurrent Data Store (CDB) database. Each process is single-threaded and does no explicit locking of the database. When each process terminates normally, it calls DB->close() and DB_ENV->close(). When all processes have terminated, there shoul...

Is Software Transactional Memory the same as database transactions?

I have read alot about Software Transactional Memory, especially in relaiton to Haskell but I am trying to figure how it is different from database transactions? Are there some advantages I do not understand with STM? ...

Insert into a star-schema

I've read a lot about star-schema's, about fact/deminsion tables, select statements to quickly report data, however the matter of data entry into a star-schema seems aloof to me. How does one "theoretically" enter data into a star-schema db? while maintaining the fact table. Is a series of INSERT INTO statement within giant stored proc ...

Can someone describe the nested set model from a C#/LINQ perspective?

I know the nested set model doesn't pertain to the C# language or LINQ directly... it's what I'm using to develop my web app. For hierarchical data (categories with sub-categories in my case), I'm currently using something similar to the Adjacency List model. At the moment, I've only got 2 levels of categories, but I'd like to take it f...

What are good alternatives to SQL (the language)?

I occasionally hear things about how SQL sucks and it's not a good language, but I never really hear much about alternatives to it. So, are other good languages that serve the same purpose (database access) and what makes them better than SQL? Are there any good databases that use this alternative language? EDIT: I'm familiar with SQL a...

Connect two database from 2 different host

Hi, currently I have two websites: 1. A website connected to mySQL database in host A. 2. A website connected to Ms. Access database in Host B. Is there anyway if I update the database in Host B, the database in Host A can be updated automatically? Thank you. Really appreciate your help. ...

update iphone application behaviour

Hi, I developed one database related application for iPhone device(SQlite database). Now i want to update that application with more features(I want to push an update for the same application). Here i am more concerned about the user data while pushing the update so my question is if i will push an update then does the update will clea...

How to handle Foreign key for optional field in .NET

What is the best way to handle following situation? A dropdown(for master table) is optional in a particular form. But, In database table the field is constrained with foreign key. If user don't select from dropdown then It creates problem because of foreign key. One solution is to create default option in master table and use it in ca...

Graphical database monitoring tool for debugging

I would love a tool that in real-time showed changes in a set of predefined tables in a graphical way, for example different colors on fields that has changed value, added records, deleted records etc. I don't want a list of all transactions (like SQL Server Profiler), instead a clever visualized more graphical approach where you can get...

Event triggering in server-side scripts

In SO, when your question got answer. or you got new badge, event is triggered. Or when you got new PM in forum, it also lets you know by alerting message. You see message that something happened with your account when you enter site for first time after this event. How is this implemented? How do scripts know, that they have something...