database

Assigning Roles to Users

I'm having trouble figuring out how to assign roles to users. I've got the log in mechanism working, but need to figure out how to use roles defined to give users certain access. I have a database with these tables: Tables ------ UserTbl RolesTbl UserInRoleTbl ------- ...

Difference between select from table directly and view

What is the difference between SELECT data from table directly or from view? And What is the best use for each one? ...

Property-values database

I have a number of objects, each one have an arbitrary number of shared, and distinct property-value pairs (more specifically: files, and their related properties -such as width, and height values for images, album/artist/length for music files, etc). I'd like to be able to search for objects having specific property/values (such as: by ...

Using a table to keep the last used ID in a web server farm

I use a table with one row to keep the last used ID (I have my reasons to not use auto_increment), my app should work in a server farm so I wonder how I can update the last inserted ID (ie. increment it) and select the new ID in one step to avoid problems with thread safety (race condition between servers in the server farm). ...

flexgrid in vb.net

how to store data from flexgrid in vb.net to oracle database? ...

What is the equivalent of Firebirds "STARTING WITH" when using other databases e.g. Oracle?

I am investigating the possibility of updating our application to work with database servers other than Firebird. We rely on "STARTING WITH" for accessing our hierarchical data. Without it, I don't see how we can migrate to another database without some serious redesign. If you are not familiar with STARTS WITH, it simply checks to see ...

Improving performance of Sql Delete

We have a query to remove some rows from the table based on an id field (primary key). It is a pretty straightforward query: delete all from OUR_TABLE where ID in (123, 345, ...) The problem is no.of ids can be huge (Eg. 70k), so the query takes a long time. Is there any way to optimize this? (We are using sybase - if that matters). ...

Problem creating a view containing lookup tables

Hi there guys, should be simple enough but it's causing me a couple of issues. I have a data set similar to the following: User UserID Name Age UserPropertyValues UserID PropertyCodeValueID PropertyCodes PropertyCodeID PropertyCodeName PropertyCodeValues PropertyCodeValueID PropertyCodeID PropertValue Now let's...

Entity relationship

Hi, I have started develping database for machineries performance mgt system Facts: 1.A machine(platNo,model,name) can work on several cane fields(fieldNo,fieldNo) - machine vs field 2.Many machineries can work on a cane field 3.A machine can do tasks for many userDept(deptId,deptName) 4.A userDept demands several machines for its ac...

How to parse emails and transfer to DB

Hey there, I have seen some web apps that allow me to email stuff to a special ID and it magically turns up in my account. How exactly do they do this? ...

mysql - select pagination chunk that includes a given id

...before the pagination chunks have been determined. I know you can do this in multiple statements, but there must be a better way. my results are returned ordered by date and I want to return the pagination chunk that contains a given id. So I could, for example, select the date of the given id and then select a chunk of results ...

MySQL import/export version incompatibilty

Hi I have taken a dump from my mysql database on my own server (version 5.0.67) and I have tried to import it to my other database (version 5.0.54). However, I get the error: ERROR 1193 (00000) at line 23: Unknown system variable 'character_set_client' I think it refers to this part: SET @saved_cs_client = @@character_set_client...

Best way to handle LARGE strings of text going into a database?

Hey all, I have built a number of solutions in the past in which people enter data via a webform, validation checks are applied, regex in some cases and everything gets stored in a database. This data is then used to drive output on other pages. I have a special case here where a user wants to copy/paste HUGE amounts of text (multiple...

In Oracle, is it possible to "insert" a column into a table?

When adding a column to an existing table, Oracle always puts the column at the end of the table. Is it possible to tell Oracle where it should appear in the table? If so, how? ...

Silverlight 2 - Adding database records using WCF

I'm creating a simple Silverlight 2 application - a guestbook. I'm using MSSQL as the data source, I've managed to load the data but I can't find out how to add new rows (messages) to the database. I crawled all the internet but didn't find any working solution. The SCMEssages table has four columns - MessageID, MessageDate, MessageAuth...

MySQL database optimization best practices

What are the best practices for optimizing a MySQL installation for best performance when handling somewhat larger tables (> 50k records with a total of around 100MB per table)? We are currently looking into rewriting DelphiFeeds.com (a news site for the Delphi programming community) and noticed that simple Update statements can take up ...

Is there a way to stop SQL Express 2008 from Idling?

I am using SQL Express 2008 as a backend for a web application, the problem is the web application is used during business hours so sometimes during lunch or break time when there is no users logged in for a 20 minute period SQL express will kick into idle mode and free its cache. I am aware of this because it logs something like: S...

When listing information from a database using php and mysql how would you make the first row look different to the rest?

Basically I have articles in my database and I want to alter the way the first record displays. I want the lastest (Posted) article to be the focus and the older article just to list, (see F1.com). I need to know how to get the first of my values in the array and get it to display differently but I am not sure how to do this, I can do it...

release a db lock when php session ends?

Suppose a user is editing a record from a database, in the schema you have a field named 'lock' so users can not edit concurrently the same record, once the user ends editing you set lock = false to allow other users to edit the record. My question is, can i run some code when php session ends, so if a user walks away from computer, clo...

Where should I get started with learning databases?

I just got a decent idea for an application, but it would involve some database work and a central server. I have never worked with databases or servers before. What are some advised database query languages for a beginner? The languages I work with right now are C#, C++, Perl, and Python, but I do not care if I have to learn another ...