database

MySql Says Column can't be null for a column that is not null! [using named parameters]

I am trying to execute an INSERT INTO query using .Net through the MySql/.NEt connector. The query makes uses of Parameters. It is rather simple: INSERT INTO post ( ID, content, post_url, blogID, title, addedOn, updatedDate, commentsFeedURL, active, viewCount, commentCount, languageID, authorName, postDate, posRating, negRating, adul...

Enforce Referential Integrity on Materialized Path?

I'm trying to implement a tree like structure using a Materialized Path model described here: http://www.dbazine.com/oracle/or-articles/tropashko4. Is it possible to enforce referential integrity on the [path] field? I don't see how SQL could do it, do I have to do it manually in the DAL? ...

Impact for increasing the column length of an existing table.

The datatype of a column in a existing table is of type Char(4). Now, is there any impact while selecting that row if I increase the column length to say 10. ...

Generating unique database IDs in code

One requirement is that when persisting my C# objects to the database I must decide the database ID (surrogate primary key) in code. Second requirement is that the database type for the key must be int or char(x)... so no uniqueidentifier or binary(16) or the like. These are unchangeable requirements. What would be the best way to go ...

Database clustered Index on referring column

I have two tables like this. Table A A_ID ( Primary Key) A1 A2 Table B B_ID ( Primary Key) B1 B2 A_ID ( foreign key but not enforced in database, not unique ) Although by default SQL server creates clustered indexes on B_ID, I have lot of select queries on B, which depend on A_ID something like this SELECT * FROM B WHERE B.A...

To INSERT INTO a database uniquely by PostgreSQL

My table question_id | title | user_id | +---------------+---------------------------------+----------------+ Its types are Column | Type | Modifiers --------------------------------------...

What is the maximum SQL table size

Hello, I am wondering at which point would my MySQL table be considered too big. The table is this: id customer_id (int) value (float) timestamp_1 (datetime) tmestampt_2 (datetime) so the row size is not too great, but would be constantly being added. In my estimation I am looking at around 17000 new rows a day, so about 500,000 a ...

How to delete completely the initial table in android

I created a table with the name SONGS in the assets/folder. And after that I create a new project, my project run to create a database name "data" with table name "BOOKS". But I found that the table "SONGS" also created in my new database? And now my database have two table "BOOKS" and "SONGS". I don't know why? How can I delete complete...

To understand PHP's include -command

I would like to have all variables accessible of the file *handler_login.php* which I include in the file *handler_question.php*. The *handler_question.php* processes the data from the following form. My form_question.php <form method="post" action="handler-question.php"> <p>Title: <input name="question_title" type="text" c...

craigslist’s / kijiji's schema

Hello, I'm curious to find out what kind of database schema craigslist and kijiji uses. They have many categories and cities that grow all the time. The levels also get deeper sometimes (sub-categories, and areas/neighborhoods). The part I don't understand the most is how they manage their categories. What is the database structure be...

web front-end for database

I'd like to know if there is some open source web front-end for databases. I'd like something where queries can be executed from a web browser, only read-only queries are fine. If possible it would be great to be able to select with a gui the columns that are displayed as the result of the query. As several people asked me, I use Oracle...

How do I retrieve images within Postgres into Matlab using Java?

Hi, I have been given a bit of a strange task, there are around 1500-2000 jpeg images all of around 1-50kb in size. They are currently stored in a simple database I made with Postgres. It's been a long time since I used Matlab and Postgres heavily so any help or suggestions is really appreciated! I need to get the images that are store...

If you have a db table with a unique column (like "name"), how would you go about switching the names of two rows? (Using Hibernate, but it sounds like a problem across the board)

Let's say you had a table like this /------------ | id | name | |------------| | 1 | foo    | | 2 | bar    | ----------- There is a uniqueness constraint on the 'name' column. How would you set #2's name to foo, and #1's name to bar? I know you could probably just assign temporary names to both then stick in the desired names,...

p-400 database system?

has anyone heard of this system? i think it could be S-400 or F-400. google search came up with nothing. is it running oracle? are there many front-end programs for it? ...

How do you upgrade a database schema with InstallShield?

I am using InstallShield to install a SQL Server DB, and the applications that use it. Now I need a way to go back and say, ok, v 27 of the database now needs moved to 28. I have the alter scripts, and I know based on a table which version any given DB is. How can I make InstallShield do this? ...

english dictionary API with phonetics and accents?

I'm not only a programmer, but an amateur poet, and I'd like to build some custom rhyming dictionary programs. I want to be able to specify what kinds of rhymes and follow patterns on the rhythm of words (iambic vs trochaic) as well as the sound. So, is there an API, dictionary DB essentially for english that has the spelling of words ...

ASP.NET Image Upload Architecture

What would be the best method to implement the following scenario: The web site calls for a image gallery that has both private and public images to be stored. I've heard that you can either store them in a file hierarchy or a database. In a file hierarchy setup how would prevent direct access to the image. In a database setup access to ...

To use prepared statements by PHP for Postgres

This is a similar question to this "When not to use Prepared statements?", but with the "how-to" -part and for PostgreSQL. I know that I need prepared statements because I make more than one call to my database during one script. I would like to get concrete examples about the following sentence Look at typecasting, validating and ...

SQL: Select maximum value for each unique key?

Sorry, I'm not sure how to phrase that and I'm really not very good with SQL. The db engine i SQL Server Compact. I currently have this query: SELECT * FROM Samples WHERE FunctionId NOT IN (SELECT CalleeId FROM Callers) ORDER BY ThreadId, HitCount DESC Which gives me: ThreadId Function HitCount 1 164 6945 ...

To understand the validation of user's data for prepared statements

I read that you do not need to validate or sanitize user's input if you use prepared statements. This however does not make sense to me in the following example. The user gives his email address. I normally run this Validation code // to validate data if (!filter_var($_POST['email'], FILTER_VALIDATE_EMAIL)) { header("Location...