database

Oracle database links between 10g and 11g

Does anyone have experience with database links between 10g and 11g? Is this a supported setup/operation? Is it possible? Are there any problems? Caveats? ...

what persistence layer (xml or mysql) should i use for this xml data?

i wonder how i could store a xml structure in a persistence layer. cause the relational data looks like: <entity id="1000070"> <name>apple</name> <entities> <entity id="7002870"> <name>mac</name> <entities> <entity id="7002907"> <name>leopard</name> ...

MySQL UPDATE WHERE IN for each listed value separately?

Hi, I've got the following type of SQL: UPDATE photo AS f LEFT JOIN car AS c ON f.car_id=c.car_id SET f.photo_status=1 , c.photo_count=c.photo_count+1 WHERE f.photo_id IN ($ids) Basically, two tables (car & photo) are related. The list in $ids contains unique photo ids, such as (34, 87, 98, 12). With the query,...

How to insert data into database using jsonreader in JSP

Hai can u please tell me how to insert, delete data into and from table using jsonReader in jsp ...

How to create database project from existing SQL Server database?

By using VS TFS Database Edition 2008, how to create dbproject from an existing SQL SERVER database? ...

Q&A database map like stackoverflow - seperate table for questions titles

I am planning to make Q&A system (quite specific, has nothing to do with IT) I was looking for Stackoverflow database map: http://meta.stackoverflow.com/questions/2677/anatomy-of-a-data-dump/2678#2678 And I am thinking is not it is better practice to make separate table for questions titles. With "firstPostId". Instead of |- PostTy...

how to copy database files from the network access server to Client PC in .net?

im using a code to copy the files from the database of server PC. so im accessing that server PC through IP address but it is giving me error and not copying the files in the folder of my PC (client PC) this is my code that im using...can u tell me where im wrong?? the file path is given on my listview in winform.. public string Record...

Image Uploading in a web aplication.

actually i m devloping a web application that provides facility to users upload the image as we see in orkut and facebook through a form and a upload button.but the actually problem I am facing is : 1.should i store the image in database using Large data objects ie BLOB and the problem arises of retrieving it back from the database and...

"Create table if not exists" - how to check the schema, too?

Is there a (more or less) standard way to check not only whether a table named mytable exists, but also whether its schema is similar to what it should be? I'm experimenting with H2 database, and CREATE TABLE IF NOT EXISTS mytable (....) statements apparently only check for the table´s name. I would expect to get an exception if there...

Multiple rows update trigger

If I have a statement that updates multiple rows, only the trigger will fire only on the first or last row that is being updated (not sure which one). I need to make a trigger that fires for ALL the records that are being updated into a particular table ...

Dynamic data validation in ASP.NET MVC

I've recently read about the model validation capabilities of ASP.NET MVC which are all very cool until a certain point. What happens if the application doesn't know the data that it works with because it is all stored in DB and built together at runtime. Just like in Drupal, I'd like to be able to define custom types at runtime, and ass...

methods of joining 2 tables without using JOIN or SELECT more than one distinct table in the query

Is there a way of joining results from 2 tables without using JOIN or SELECT from more than one table? The reason being the database im working with requires queries that only contain SELECT, FROM, and WHERE clauses containing only one distinct table. I do, however, need information from other tables for the project i'm working on. More...

How can I set default seed for all identities within a SQL Server database?

Is there a way to tell SQL server to use specific default seed value for IDENTITY columns - assuming the (to be run) CREATE TABLE statements do not specify one? I don't really care about altering existing data or altering the seed values for specific IDENTITY columns. I want the same seed for all newly created identity columns. Assume I ...

Overwriting the content from one MOSS content database to another

We have a content database on our live moss server. It contains one site collection with several sub-sites. I'm using the stsadm export command to produce a cmp file, then moving this to our test server in a different farm. I then want to import this content into the content database on our test farm, using the import stsadm command re...

How would I order this SELECT statement in MySQL?

cursor.execute("SELECT user_id FROM myapp_location WHERE\ GLength(LineStringFromWKB(LineString(asbinary(utm), asbinary(PointFromWKB(point(%s, %s)))))) < %s"\ ,(user_utm_easting, user_utm_northing, 500)); This query selects users which are within 500 feet of the current user. How would I order people by the distance? (the...

how to rethrow same exception in sql server

I want to rethrow same exception in sql server that has been occured in my try block. I am able to throw same message but i want to throw same error. BEGIN TRANSACTION BEGIN TRY INSERT INTO Tags.tblDomain (DomainName, SubDomainId, DomainCode, Description) VALUES(@DomainName, @SubDomainId, @Domai...

SQLiteQueryBuilder.buildQuery not using selectArgs?

Alright, I'm trying to query a sqlite database. I was trying to be good and use the query method of SQLiteDatabase and pass in the values in the selectArgs parameter to ensure everything got properly escaped, but it wouldn't work. I never got any rows returned (no errors, either). I started getting curious about the SQL that this genera...

MySql Query lag time / deadlock?

When there are multiple PHP scripts running in parallel, each making an UPDATE query to the same record in the same table repeatedly, is it possible for there to be a 'lag time' before the table is updated with each query? I have basically 5-6 instances of a PHP script running in parallel, having been launched via cron. Each script gets...

How do I get save (no exclamation point) semantics in an ActiveRecord transaction?

I have two models: Person and Address which I'd like to create in a transaction. That is, I want to try to create the Person and, if that succeeds, create the related Address. I would like to use save semantics (return true or false) rather than save! semantics (raise an ActiveRecord::StatementInvalid or not). This doesn't work because ...

Aggregation over a few models - Django

Hi folks, I'm trying to compute the average of a field over various subsets of a queryset. Player.objects.order_by('-score').filter(sex='male').aggregate(Avg('level')) This works perfectly! But... if I try to compute it for the top 50 players it does not work. Player.objects.order_by('-score').filter(sex='male')[:50].aggregate(A...