database

What is a Key Lookup in a Database and what's the difference with Business Rules ?

I was wondering what really is a Key lookup in a database ? And what are the differences between Key Lookup and Business Rules? Thank you guys ! ...

Java PreparedStatement UTF-8 character problem

Hi All; I have a prepared statement: PreparedStatement st; and at my code i try to use st.setString method. st.setString(1, userName); Value of userName is şakça. setString methods changes 'şakça' to '?akça'. It doesnt recognize UTF-8 characters. How can i solve this problem? Thanks. ...

Break up data from one column into multiple columns in a new table (MySQL)

I have a table full of data, where one column is full of different entries for each row, where the data is formatted like this: A:some text|B:some other text|C:some more text| I want to separate those strings of text into two columns on a new table. So the new table should have one column for A, B, C etc. and the other column will have t...

Find Similar Rows in Database

I try to design my app to find database entries which are similar. Let's for example take the table car (Everything in one table to keep the example simple): CarID | Car Name | Brand | Year | Top Speed | Performance | Displacement | Price 1 Z3 BMW 1990 250 5.4 123 23456 2 ...

I'm storing code snippets in my database. How can I enable revisions/versions of them?

I have a pretty primitive table schema now ( in Postgres ): CREATE TABLE "public"."sandbox_demo" ( "id" int4 DEFAULT nextval('sandbox_demo_id_seq'::regclass) NOT NULL, "source" text DEFAULT NULL NOT NULL, "created" timestamptz(6) DEFAULT NULL NOT NULL, "modified" timestamptz(6) DEFAULT NULL NOT NULL ) However, this tab...

CHARINDEX always 0 when looking for substring

I have the following in a field ABCD, EFG, HIJ and can confirm this by selecting it. I need to be able to search this string for ABCD so I used the following: case when CHARINDEX(g.letters ,'ABCD') <> 0 then (- 2) else (- 1) end However its always returning -1 ...

Doctrine one-to-many relationship returns a Doctrine_Record instead of Doctrine_Collection

I've run into a bit of a snag in my application where a relationship defined as a one-to-many relationship returns a model object (instance of Doctrine_Record) instead of a Doctrine_Collection when I try to access it as $model->RelatedComponent[] = $child1. This, of course, yields an exception like so: Doctrine_Exception: Add is not ...

SQLite table with integer column stores string

I found something weired in my application. I created a table with a column named type which should store integers: db.execSQL("CREATE TABLE " + CellColumns.TABLE + " (" + CellColumns._ID + " INTEGER PRIMARY KEY," + CellColumns.TYPE + " INTEGER," // <-- this + CellColumns.CELL_ID + " INTEGER," + CellColumns.CITY_ID + " I...

How to change database design in a deployed application?

Situation I'm creating a C#/WPF 4 application using a SQL Compact Edition database as a backend with the Entity Framework and deploying with ClickOnce. I'm fairly new to applications using databases, though I don't suspect I'll have much problem designing and building the original database. However, I'm worried that in the future I'll ...

mysql query sum based on years

i friend i have a database table amount_id, year, amount, and data like this 1 2002 2 2 2002 3 3 2007 2 4 2004 6 5 2004 10 i wan to run a query to select data like this 2002 4 2007 2 2004 16 thanks for help ...

Hadoop and MS SQL Server Best Practices

Hi, I've been following Hadoop for a while, it seems like a great technology. The Map/Reduce, Clustering it's just good stuff. But I haven't found any article regarding the use of Hadoop with SQL Server. Let's say I have a huge claims table (600 million rows) and I want to take advantage of Hadoop. I was thinking but correct me if I'm ...

how to open and view sybase dat file

is it posible to simply open and view a sybase dat file? I've been trying to look for a tool but every tool asks for server information, and I just want to open the file. thanks. ...

User content table formatting?

I understand the part of inserting data in the database for creating a database driven user content website but how to do formatting? Say i insert the "Privacy policy" Now some text may require to be bold, some may be underline, some may have different size, spacing, etc. So do we have to insert each word 1 by 1 or how to handle this? Us...

Preferable way to write Delphi database apps with transactions & data-aware components

Hi, What is the preferable way to write Delphi database applications using transactions and also data-aware components? I have to write a client app that access InnoDB tables, and do some master-detail kind of things inside transactions. After doing some research on transactions (from general point-of-view), then I humbly make a conclu...

HTML5 localStorage design questions

What is the best way to store object data in HTML5's localStorage. I haven't worked much with key value storage. In my research i've seen a few different approaches. example data: var commands = [ {invokes: 'Window', type: 'file', data: '/data/1'}, {invokes: 'Action', type: 'icon', data: '/data/2'}, {invokes: 'Window', type: 'fi...

Is naming tables september_2010 acceptable and efficient for large data sets dependent on time?

I need to store about 73,200 records per day consisting of 3 points of data: id, date, and integer. Some members of my team suggest creating tables using month's as the table name (september_2010), while others are suggesting having one table with lots of data in it... Any suggestions on how to deal with this amount of data? Thanks. =...

Database design for Group Notification System

I am trying to create a group notification system. If I am in a group, then anyone who comment on the group's wall, a notification will send out to every group member. Here is my database design: I have two tables: Notification and NotificationRead. NotificationRead +userId (String) +lastRead (int) - default is 0 Notification ... +time...

Mysql - Count how many rows have a certain number?

Hello, I have a query that checks a tables and groups all entries from a user and counts those entries SELECT username, count(userid) FROM orders GROUP BY userid This returns a list of username's and how many orders they have submitted username count(userid) ------------------------ test 1 test2 1 tes...

Grails iterating through database tables

As I'm a bit new to grails, I'm wondering how I can iterate through the current data i have saved in the database to check if the information already exists. For instance, lets say I have a domain class for Books and I create an action that automatically adds more books but I want to check if the book.title already exists so I don't add...

How to create Access database from a script.

I would like to create an Access database from a script. Ideally, I would love something similar to the way SQL scripts can be used to create a SQL database. Is this possible at all? Is there anything that would leverage the SQL scripts I already have? I want to create the same database structure as my SQL database. Let me know if you...