database

Cannot drop a column in Sybase table

Hi, I tried to drop a column in a Sybase table but I am getting this exception: Can't allocate space for object 'TABLE1' in database 'SAMPLE' because 'default' segment is full/has no free extents. If you ran out of space in syslogs, dump the transaction log. Otherwise, use ALTER DATABASE to increase the size of the segment. I already t...

Embedding mysql in java desktop application

hi i am not clear about steps/configuration details about how i can embed mysql in a Java desktop application so that it(application) can be installed on any machine through a single executable file and doing so sets up database and also provides an exe to run the app.Till now i have built my app using netbeans and i have used mysql to s...

HowTo: display custom error message when unique index fails on object save

I have added an index on a table just to ensure that a set of fields together form a composite unique key (Is this approach correct? or is there a better option with Doctrine?) After having done that, when I try to save an object and the unique constraint fails, a SQL exception is generated. What is the best way to handle this? and to d...

Problem with LONG in Oracle

hi, i have an old oracle database in which there is a field of type LONG(max size is 2GB) Now earlier it used to work fine but with time data we started putting was of size much more than 2GB so we started facing trouble. I can not change the field type from LONG to CLOB since that will create a lot of trouble as innumerable changes ...

Get the top row after order by in Oracle Subquery

I have a table student(id, name, department, age, score). I want to find the youngest student who has the highest(among the youngest students) score of each department. In SQL Server, I can use following SQL. select * from student s1 where s1.id in (select s2.id from student s2 where s2.department = s1.department order by age asc, sc...

DataSet and XmlDataDocument

What is the importance of using XMlDataDocument with dataset. It is getting me bit confused Can some one please explain the importance of this? thanks ...

Difference between Blob and a file

Hey! What is the difference between saving a file (e.g. AVI) as a Blob in the datastore to saving it as a normal AVI file on a webserver? Thanks! Joel ...

how to store and retrieve items?

I need to store all encrypted messages so it may be retrieved and displayed by pressing a button, that is, press the button 3 times for the last 3rd message; After retrieving an encrypted message , let user guess (type into a textbox) the original message and press a button. Display how many characters are correct and how many wrong. R...

What is your opinion on using textual identifiers in table columns when approaching the database with normalization and scalability in mind?

Which table structure is considered better normalized ? for example Note: idType tells on which thing the comment has taken place on, and the subjectid is the id of the item the comment has taken place on. useing idType the textually named identifier for the subjectid. commentid ---- subjectid ----- idType --------------------------...

If i can store my data in text files and easily can deal with these files, why should i use database like Mysql, oracle etc.

I can easily do my work with text files and database both. But i want to know which one is good in terms of response time. If text files is not the best solution for fastest result then which database is best, again in terms of response time. I can trade off size for response time. Please help me. ...

MySQL - How can I get names of all students that were taught by teacher with name John?

How can I get all students names that were taught by the teacher with name John? student id name student_has_teacher teacher_id student_id teacher id name ...

MySQL -PHP insert DATETIME

can anyone please guide me on How to insert a DATETIME filed from iphone through PHP script into MySQL database. $dates = date('Y-m-d H:i:s','2010-10-12 15:09:00'); $query = "INSERT INTO timeTable(time) VALUES ('$dates')"; Thank you.. ...

MySQL - Is using TEXT for potentially small strings overkill?

One of the things that always worries me in MySQL is that my string fields will not be large enough for the data that need to be stored. The PHP project I'm currently working on will need to store strings, the lengths of which may vary wildly. Not being familiar with how MySQL stores string data, I'm wondering if it would be overkill to...

How to show row numbers in PostgreSQL query?

I'd like to show the observation number for each record returned by a PostgreSQL query. I think in 8.4 windowing functions can perform this capability. Edit: I think I just found the answer, but since this hasn't been asked before, I'll keep the question open. I also welcome non-windowing function possibilities. Edit 2: So a little t...

SyncStagedProgressEventArgs converted to DbSyncSessionProgressEventArgs

I am working on an app that is using Synchronization Framework v2. I am basically done with it, but would like to offer some better fedback about the progress of the synchronization. I was looking at one of the Synchframework examples that Microsoft offers, SharingAppDemo-CEProviderEndToEnd, and see that the have a method in the Progress...

In database design what do "n:m" and "1:n" mean?

Title says it all :) Thanks ;) ...

How to find best match across multiple optional properties

Suppose we have a table with different columns representing properties of an object e.g. Colour, Size, Model... many more. How can we get the best matching row if we query for Colour= red, Size= M and Model = x. I want to get the row which matches most of the criteria specified so possibly Red,S,null Red,null, null Red, M, null Here...

Is it possible to add a function-based database-agnostic index via a Rails/ActiveRecord migration?

I have an ActiveRecord model like this: create_table "books" do |t| t.string "title" end class Book < ActiveRecord::Base default_scope :order => 'lower(title) DESC' end As you can see I want to sort by the lowercase form of the title attribute, but this imposes a performance hit at the database level. This hit can be remedied in ...

Ensuring index is used on Informix DATETIME column

Hi. Say I have a table on an Informix DB: create table password_audit ( username CHAR(20), old_password CHAR(20), new_password CHAR(20), update_date DATETIME YEAR TO FRACTION)); I need the update_date field to be in milliseconds (or seconds maybe - same question applies) because there will be multiple updates of the pa...

frustrating query - news feed like facebook

im trying to have news feed like facebook. Database Dump http://www.2shared.com/document/RXQ13S-n/exported.html i have feed table, which gets feed for text, image or video. i want to group the latest video and images feed and show them as one row and if someone feed comes after it, then group gets break for that row. the following que...