database

Check that url already exsists in the database and outputting the exsisting created url

I've created a script called spiralurl (tiny url script). I'm still learning and making changes as I go. One thing I can't get fixed is to check that the user entered url already exists in the database, if it does exist I want output to the user the already shorted url previously created. Script is at: http://redspiral.net/spiralurl An...

How can I manipulate a local database with Perl?

I'm a Perl programmer with some nice scripts that go fetch HTTP pages (from a text file-list of URLs) with cURL and save them to a folder. However, the number of pages to get is in the tens of millions. Sometimes the script fails on number 170,000 and I have to start the script again manually. It automatically reads the URL and sees if ...

Best practices for huge volumes of data load/unload?

My question applies to ETL scenarios, where transformation is performed outside of database (completely). If you were to Extract, Transform, and Load huge volumes of data (20+ million records or more) and the databases involved are : Oracle and MSSQL Server, what would be the best way to: Effectively read from the source database : I...

finding same locations in a database

Consider an app that stores geocode data for photos. I want to be able to return albums of photos from within a city, within a state or within a country. Currently the database uses location strings for matching (location_name = "London, UK"). This is a very simple calculation compared to actively querying through map geometry, but has...

SQL: Select first row in each a GROUP BY group?

As the title suggests, I'd like to select the first row of each set of rows grouped with a GROUP BY. Specifically, if I've got a "purchases" table that looks like this: > SELECT * FROM purchases: id | customer | total 1 | Joe | 5 2 | Sally | 3 3 | Joe | 2 4 | Sally | 1 I'd like to query for "the id of the largest...

Updating record in Database

Hello, I have this form on my site where a user can enter many strings and save it to their account. But I'm not sure how to go about it. Instead of creating a whole new user, with new values, I'd just like to update a single entry in the database. For example if a user wanted to add another email address to their account, how would I...

Entity framework: Best practice for case (as in pascal-case) in database tables/columns

In C# I always use PascalCase for properties (best practice, right?), for databases i always use lowercase for tables and columnnames (best practice, right?) When I generate classes from tables using entity framework, i get lowercase property names in C#, so I manually refactor the case in C#. I wondered, is it best practice to use Pas...

How to SELECT whole table with OTL, and save it to file?

Here is the problem, I dont know how many attributes or which type are the attributes in table and I need simple select statment like: SELECT * FROM TABLE1; to write down to file. And this need to be done with otlv4 wrapper. Please help. otl_stream i(50, // buffer size "select * from test_tab where f1>=:f<int> and f1...

Is there any php framework which exactly reflect the msaccess

Hi I am fond of dbstructure definition of msaccess which lets defining at once and creating the data entry forms, datatables and reports at once easily. I have been searching for some framework which would generate the data entry forms, data tables and reports easily. I guess the only thing I need to define is complete datatable struc...

How to efficient store graphs in SQL database (e.g., mysql)?

I have a tree like graphs and I need to store them into database. I am looking for information how to efficiently store and query graphs in SQL database. ...

mysql PDO SET statement encounter errors

I was looking for something that is related to a mysql query and I stumbled to this link mysql variable usage and saw the stored proc-like variable setting. I've tried it in phpmyadmin : SET @value = 5; SELECT @rank; and it is working, but when I tried to place it in PDO statements, it does not work. $value = "SET @value = 0"; ...

Zend Frame Work Data base Configuration and connection

I have installed zend server for zend framework.I didnt install xampp or wampp.Which software i have to install for database configuration. ...

is email address a bad primary key

Is email address a bad candidate for primary when compared to auto incrementing numbers. Our web application needs the email address to be unique in the system. So, I thought of using email address as primary key. But, my colleague suggests that string comparison will be slower to integer comparison. Is it a valid reason to not use ema...

Internal HSQL database complains about privileges

I'm setting up a standalone Java service with an in-process, in-memory HSQL database. Persistence.xml <persistence xmlns="http://java.sun.com/xml/ns/persistence" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://java.sun.com/xml/ns/persistence http://java.sun.com/xml/ns/persistence/persistence_2_0.xsd" ...

MySQL Merge tables - high-traffic and large amounts of data

My work currently uses MySQL (MyISAM) exclusively for all data storage. We currently have over 300 webservers and about 150 databases. Unfortunately I'm in a position to have to write a table structure to support over 100 million rows in a 30 day period. The idea is: High volume inserts (no updates or deletes and always at the end of t...

FILESYSTEM vs SQLITE, while storing up-to 10M files

I would like to store up-to 10M files, 2TB storage unit. The only properties which I need restricted to filenames, and their contents (data). The files max-length is 100MB, most of them are less than 1MB. The ability of removing files is required, and both writing and reading speeds should be a priority - while low storage efficiency, r...

Executing multiple statements with SQLiteDatabase.execSQL

I've followed a standard tutorial for building a database with Android. I've created a class called DbHelper which extends SQLiteOpenHelper. I've Overridden the create handler to execute a string. @Override public void onCreate(SQLiteDatabase db) { db.execSQL(DbDefinitions.DB_CREATE); } DbDefinitions.DB_CREATE is a static String...

Object Factory Question - using database query information to create objects

I have several objects, like products, order, etc. When I get information from my database I take a row and create one of the types of objects. I then work with that object created. I read this is called a factory. Is there some advantage to doing this? Especially in a loosely typed language like PHP? Thanks edit: is this where I g...

Java Newbie: JPA and EJB workflow question

I'm just learning about JPA and session beans. I've worked through a simple database model (schema designed using MySQL Workbench) and used an IDE (NetBeans) wizard to generate the JPA entity classes and session beans. My question has to do with an appropriate workflow when the data model changes. For example, if I add a column to a tab...

Drill Up/Down example?

I need an example of what drill up/down is ( + if it's graphical ) for a better understanding of these operations. I'm new to the whole Data Warehouse subject so high level explanations would be appreciated. ...