database

mysql_query in a while loop

I'm trying to execute I have an html form in a page of this sort : Name: <input type="text" id="namebox" value="" name="fields[]" /> <br /> Position: <input type="text" id="positionbox" value="" name="fields[]" /> <br /> <input type="hidden" name="createcard"> <input type="submit" value="Create"> .. and 3 other fields. I'm passi...

Benefits of Document Orriented DBs to an existing folder structure

I would like to preface by saying I guess there is no real tangible problem, but I feel odd not having some system managing these things. We currently have a large amount of XML files located in hierarchy of directories. I think it could be useful to use some Document Oriented DB around these folders. It could be extremely useful for s...

SQL Server 2005: Attach database using sp_attach_db with full text catalog

Having issues attaching a Database and full text catalog from server A to server B with the "sp_attach_db" command in SQL Server 2005 SP3. All the database files (data, log, full-text catalog) have been copied from server A to server B. I am guessing that this is indeed possible and that my syntax is just incorrect, but I can't seem to f...

Copy a sqlite table from a disk database to a memory database in python

Hey Everyone. I am trying to figure out how to copy a disk based sqlite table to a memory database in python.I know the schema of the table. Is there any easy way to do this? ...

How to parse through a C/C++/C# project and write all packages/classes/methods into a database?

Hi For my new application I would like to parse another C, C++ or C# project, so that i can later display the graphical representation of all the classes in this project. So I thought that its a good approach to use a database with the following tables to store the necessary information: TablePackages: id | name | parentID TableClass...

How can I prevent database access error message of "too many open files" in android?

I am trying to import from a file. I am getting error message like the following. The error occurred at getColumnIndex. How can I prevent this from happening. Cursor c = activity.getContentResolver().query(android.provider.Browser.BOOKMARKS_URI, null, Browser.BookmarkColumns.TITLE+"=?", ...

Rails DB Migration - How To Drop a Table?

I added a table that I thought I was going to need, but now no longer plan on using it. How should I remove that table? I've already ran migrations, so the table is in my database. I figure rails generate migration should be able to handle this, but I haven't figured out how yet. I've tried rails generate migration drop_tablename, but ...

How can I optimize this confusingly slow query in MySQL?

I have a table of blog posts, each with a foreign key back to it's author. There are < 15,000 entries in this table. This query scans over 19,000 rows (per EXPLAIN), requires a filesort (that might be regular MySQL behavior), and takes over 400ms to return 5 rows. possibly because of the complicated WHERE used to check if the item is act...

finding the shortest way to my from one airport to another

I want to create an in-memory definition for a set of airline routes for a small airline company. I want to maintain a list of all of my planes and their current locations (or their destination location if they are currently in the air). One of the possible locations needs to be “hangar” for maintenance or repairs. I want to have the ...

DB machine CPU cycles Vs mid-tier machine CPU cycles

I have a SELECT query with lot of IF conditions, which I can do either in the query itself (takes DB machine's CPU) or I can put it in my java code (takes server machine's CPU). Is there any preferred approach here (to put conditions in DB Vs in mid-tier)? UPDATE: My query is a join on more than 2 tables, and I am using left join to co...

Using a random salt in password encryption?

Hey, I've seen a few other threads about this topic, but I can't seem to find a few answers to some questions involving the use of a random salt in password encryption. To my understanding, the steps go something like this: Generate a random salt for the user. Append the salt to their password. Use something like SHA-2 to hash the res...

What would you reccomend to read to a person who is going to write his own DB?

Since there are no answers to my previous question. I'm really thinking to implement a custom DB which will satisfy my requirements. Yes I know, sounds crazy. But what books, articles and etc. would you recommend to read? If it does matter the requirements for my DB are following Graph oriented - optimized for storing graphs and ...

Database of Indian Cities

Where can i get the database of Indian Cities ? any free resource or any one can share the DB ? ...

Sort a Query Based on Omitting A Word

if I have the following result sets: id, name 1, The Popper 2, Brittany 3, Fledgler 4, The Nightingale How do I sort them by name so that it disregards the "The" word and sorts the as follows: id, name 1, Britanny 2, Fledler 3, The Nightingale 4, The Popper Thanks in advance. I am using MySQL ...

Information regarding query profiler.

hi all, Does anyone have an information about a good query profiler?? By query i mean about 5 page search query.The profiler should be such as which gives the bottleneck in the query. thanks ...

How to put existing database in the .apk file?

I have prebuild database of mostly string objects. I want to know how to put in my apk file so the database will be already created when the user installs the database. ...

PostgreSql + Query Statement having \r in between the attributes !!!

Suppose we have a textarea in which we put example string. Textbox contain : Earth is revolving around the Sun. But at the time of saving, I just pressed a enter key after "the sun". Now the statements in texbox :: Earth is revolving around the Sun Now, in database where enter was pressed the \r is stored. Now i am trying to fetch...

Is it possible to test the transactionality of a process?

I would like to be able to verify if each unit of work is done in its own transaction, or as part of a single global transaction. I have a method (defined using spring and hibernate), which is of the form: private void updateUser() { updateSomething(); updateSomethingElse(); } This is called from two places, the website when ...

database programming with c#- book

Can someone suggest me a good c# database programming book (c# 4.0). I use visual studio 2010 and I'm just beginner of database programming . ...

Is it easier to scrape data for a gae app in dev and upload it to prod or should you scrape in prod?

I have to run a scraping task to collect data for my App Engine (Java) app. I'm not sure which is best - scrape data in development mode and upload it to prod or scrape it while the app is running in production. Does it make a difference? Are there any difficulties with bringing large quantities of data from one environment to the ot...