database

Erlang Mnesia Equivalent of SQL Select FROM WHERE Field IN (value1, value2, value3, ...)

I have an mnesia table with fields say f1, f2, f3. Now if I were to select all the rows with the field value as V1, I would use mnesia:select and match specifications or a simple mnesia:match_object. Now I need to select all the rows which have V1, V2, V3 ... or Vn (a list of arbitrary length) as the value for field f1. In SQL I would do...

problem in connecting to oracle database :((

Dear friends I try to connect to oracle 11g but I have problem and receive the below error.the error show I must have problem in my sql syntax but I run it in oracle sql developer.the query is right Please help me to solve this problem Thanks. try { string oradb = "Data Source=(DESCRIPTION=" + "(ADDRESS_LI...

archiving table records to another table by trigger(move daialy table records to weekly table, evry day)

I have written this trigger in mysql 5: create trigger changeToWeeklly after insert on tbl_daily for each row begin insert into tbl_weeklly SELECT * FROM vehicleslocation v where v.recivedate < curdate(); delete FROM tbl_daily where recivedate < curdate(); end; i want to archive records by date, move yesterday inserte...

database splitting; multiple tables

I am coding a classifieds ad web app. What is the optimal way to structure the database for this? Because of the high repeatability, would it be faster (in terms of searching/indexing) to have a separate table in the database for each city? Or would it be okay to just have one table for every city (it would have a lot of rows..). Th...

Is there a GUI which will enable me to query an XML file?

hi, I have an XML file which I'd like to query (read/write) in the same way as I would a relational database. Performance is not a big issue, I just want to be able to load the file and start querying, preferably without having to define a schema. Does anyone know if such software exists? ...

Continuously fetch data from database using Java

I have a scenario where my Java program has to continuously communicate with the database table, for example my Java program has to get the data of my table when new rows are added to it at runtime. There should be continuous communication between my program and database. If the table has 10 rows initially and 2 rows are added by the us...

ERD-CLASS design

Hello guyz,i am new to daatbase and class diagram.I just get scenarios from internet and try to develop ERD and Class Diagram for them.But the following scenario has caused me some problems, and i am not sure about my design. "Whenever an employee fills leave application form, the leave application should be appeared for approval to his...

In mySQL, Is it possible to SELECT from two tables and merge the columns?

If I have two tables in mysql that have similar columns... TABLEA id name somefield1 TABLEB id name somefield1 somefield2 How do I structure a SELECT statement so that I can SELECT from both tables simultaneously, and have the result sets merged for the columns that are the same? So for example, I am hoping to do some...

Validation - Data Integrity

A table can only store 10 records in a particular state, 10 users over 30 years for example, the others must be less than 30 years. It is a business rule and as such should be respected. How to ensure that state? Think: multiple users accessing this table. Explicit Locking? ...

How do you design a database to allow fast multicolumn searching?

I am creating a real estate search from RETS data using MySQL, but this is a general question. When you have a variety of columns that you would like the user to be able to filter their search result by, how do you optimize this? For example, http://www.charlestonrealestateguide.com/listings.php has 16 or so optional filters. Granted, ...

The Biggest Data Management problems

Where does current technology fall short of industry demands in the context of data and information management? In other words, where should the software engineering industry as a whole be focusing its efforts in these areas? ...

How would I implement separate databases for reading and writing operations?

I am interested in implementing an architecture that has two databases one for read operations and the other for writes. I have never implemented something like this and have always built single database, highly normalised systems so I am not quite sure where to begin. I have a few parts to this question. 1. What would be a good resourc...

how to use .mdf while developing

I use a .mdf database for my asp.net Mvc project. The project is on source control on a tfs. When I debug the project, Visual Studio copies the database in to the debugmap. The problem is, when I debug next time, the changes (while testing the previous time) in the database are gone. The reason of this I know, Visual studio copies the o...

Questions and considerations to ask client for designing a database

Hi guys! so as title says, I would like to hear your advices what are the most important questions to consider and ask end-users before designing database for their application. We are to make database-oriented app, with special attenion to pay on db security (access control, encryption, integrity, backups)... Database will also keep s...

What are the downsides of a text-based primary index

I am working on a website and I want to make pretty urls. The urls are for certain extensions I am going to make. For example I want to have a url like this: http://www.mydomain.com/extensions/tester http://www.mydomain.com/extensions/worker http://www.mydomain.com/extensions/this-is-a-really-long-ext-name So the tester, worker, etc ar...

Drupal 6: moving localhost to server | clear cached data

Hi friends, I worked on localhost to build my drupal site. then, I moved to server. Steps: Clear cache tables (Site Configuration > Performance > Clear Cached Data button) on localhost Export db and then import on live server Move files/folders to live server Edit settings.php to reflect live server config everything is working gr...

get cells odf a JTable

hi how to display a row of a jtable in a from of JTextField when click on the row, ( I need this to edit the data base from the JTable ) My table model static class TableDataModel extends AbstractTableModel { private List nomColonnes; private List tableau; public TableDataModel(List nomColonnes, List tableau){ this.nomColonne...

Implementing Model-level caching

I was posting some comments in a related question about MVC caching and some questions about actual implementation came up. How does one implement a Model-level cache that works transparently without the developer needing to manually cache, yet still remains efficient? I would keep my caching responsibilities firmly within the mo...

django i can't save form with 2 foreign keys

i have a Reply class: class Reply(models.Model): reply_to = models.ForeignKey(New) creator = models.ForeignKey(User) reply = models.CharField(max_length=140,blank=False) a replay form: class ReplyForm(ModelForm): class Meta: model = Reply fields = ['reply'] where New is the Post class (containing users posts...

Getting deadlocks in MySQL

We're very frustratingly getting deadlocks in MySQL. It isn't because of exceeding a lock timeout as the deadlocks happen instantly when they do happen. Here's the SQL code that is executing on 2 separate threads (with 2 separate connections from the connection pool) that produces a deadlock: UPDATE Sequences SET Counter = LAST_INSERT...