database

How to pick a default value to the column in the trigger?

We implement some triggers which perform some operations with insert data before committing them to the database and when some conditions fail the trigger should pick up the default value for corresponding column. How to perform it inside the trigger? Thank you. PS. we work with postgersql, but other implementation with othee dbs may g...

How would you deal with sensitive data in your database?

In some project we have very that even our staff is not suppose to have access to. In theory, we have policies to ensure they don't. In practice, we are in Africa and policies don't mean a lot, no matter how strongly you enforce it. I would like to know is there is a way to encrypt data in your database so: each user password encrypt ...

Linq to Sql problem

I have 2 tables Users and Queries. They are connected via FK(UserId) in Queries table. I need to add queries added, for example, by user with login "Bob" to all users. Here is a chunk of code i'm using: public bool SaveUserQuery(string userName, Query query) { var db = new UserDataClassesDataContext(); Table<User...

Is having "standard" columns in your database tables common and good practice? or is this overkill?

Our database currently has "CreatedByUser", "CreatedTime", "ModifiedByUser", "Modified Time", "Status" and "Description" for all the tables in our database. Sometimes it is used correctly but for the most part, it is not. Is this a standard practice or is this totally overkill? If it is standard practice, is there an easy way to automate...

PHP Include or copy paste mysql login info on every page?

Is it safe to use php_include file for mysql login information or is is better to copy/paste the login info for mysql on every page? If you go with php_include, how will you block that file from being seen? ...

Multilingual translation - open source framework?

Are there any open source framkework to help with management of content for language translation? Like users can select their language of choice, system will pull in all untranslated text for that language, user can enter their translations, wait for 3-4 other people to verify it then push it live. Similar to facebook translation applica...

how to create a Storm table with no primary key?

I'm trying to use Storm to create an ORM to an existing MySQL db. I'm trying to create a table Class for one of the tables but I'm getting this error: storm.exceptions.ClassInfoError: <class 'statsstorm.Aggframe'> has no primary key information This table has no primary key, or any combination of columns that produce a unique row. It...

Java embedded DB which does not require JDBC

I have the following requirements: Keeping a list of users on disk for future loading. Each user has maybe 3 or 4 properties. Dozens to hundreds of users is typical, thousands of users must be supported (support for more than say 10,000 is not necessary). Keeping a list of records on disk for future loading. Each record has probably a ...

Merge two MySQL tables

Hi, I have two tables: data and comments data: ------------------- id | name | email | pics: ------------------- msg_id | pic | The data is assosiated by id and msg_id. How I can merge this two tables into final one? Edit: some rows in data don't have associated a pic, and i need to keep them. ...

How do I get LIKE and COUNT to return the number of rows less than a value not in the row?

For example: SELECT COUNT(ID) FROM My_Table WHERE ID < (SELECT ID FROM My_Table WHERE ID LIKE '%4' ORDER BY ID LIMIT 1) My_Table: X ID Y ------------------------ | | A1 | | ------------------------ | | B2 | | ------------------------ | | C3 | | -----------------------...

C# MongoDB Driver With Support For Replica Sets

Hi. Is there a C# MongoDb Driver which supports replica sets? ...

Native XML Databases with .NET

Are there any native XML Databases (That are free and preferably open-source) that work well with .NET ...

Database Options for Blackberry

Okay, I'm new to blackberry development and I was wondering if anyone could give me a list of database options available for blackberry applications? What do developer's "normally" do when faced with the requirement of utilizing a server for their blackberry applications? Is there any one specific database that is used for a majority of ...

PHP-driven exhaustive stats - server-side text files or MySQL tables?

I've got a gaming-oriented website with 200+ users. The site has a large database tracking user plays, and one of the motivations for continued participation is the extensive statistics and rankings (S&R) with which the site provides the user. As the list of S&Rs tracked has grown, some of the more intricate calculations have been moved...

Multi tables with same schema, query design strategy?

I have an Oracle database with a dodgy design: many tables have same schema. They're pieces from a huge table, and time by time, new tables will be created with specific rows. Of course, I'm not authorized to access the huge table, only the small ones. How can I query against these tables, effectively? Many thanks in advance. ...

dynamic object relation mapping

I am trying to create an application in java which pulls out records from the database and maps it to objects. It does that without knowing what the schema of the database looks like. All i want to do is fetch all rows from all tables and store them somewhere. There could be a thousand tables with thousands of records each. The applicati...

Visual studio 2010: no data source

I run Visual C++ Windows Forms application and MS SQL server 2005. I succeeded to connect to server and view table contents (tools -> connect to database), but when I try to add new datasource, nothing is found by wizard. Why? ...

MySQL SELECT problem with encoding (cyrillic, probably)

Hi, guys! I'm working with project on exporting data from text files to mysql database Text files contain both latin and cyrillic alphabets. Here is the bug: select * from cues where data="ГЭС"; +------+------+ | id | data | +------+------+ | 1872 | АЭС | | 4671 | ГЭС | +------+------+ Why I get "АЭС" also? The same ...

Direct product of two tables

When is direct product of two tables useful? Seems like an academic thing. ...

share a same sql connection among multiple executables

I, I am looking for a way to share a sql connection between two (or more) C/C++ executables. By sql connection sharing, i mean to have a transactional context in common : the A module can start the transaction, the B module do some work, and the C can commit the transaction. Of course, if a module wants it, it can throw an exception a...