database

How to serialize custom data from database?

I've a table like this : ID Name Key Value 1 Mydata1 Mail myval1 1 Mydata1 Name myval2 1 Mydata1 Nick myval3 1 Yourdata key2 myval4 and a class like this : [Serializable] public class Mydata { public string Mail{get;set;} public string Name{get;set;} public string Nick{get;set;} } I extract from my Tab...

How to update only one row in a DataGridView?

I have a DataGridView that's populated from a DataTableAdatper, as in this tutorial. I guess since it's an ODBC MySQL connection, it's not generating DBDirectMethods for me. My question is how do I update a specific row in the DB after the user has edited it in the grid? Do I need to specify a DeleteCommand in my adapter? When would it...

Is there a defined and accepted standard SQL language?

I remember in college taking a database class where we, the students, were given the ability to choose our Database Management System. Being my first experience with databases I remember being confused that there were different syntax to the SQL statements depending upon which Database Management System used. Up until this class I was un...

Good Resources for Teradata & Business Objects?

Can any one suggest good resources and practice exercises for Teradata and Business Objects and their combination. I have no idea on where to start..I am aware of SQL, database concepts and programming languages like c, php, c++, C#. I need to learn teradata, BO practically. I need to develop applications for reporting data from Teradata...

CakePHP: Is it possible to associate a model with a database view instead of a table?

I was wondering if it was possible to create a view in a database then be able to link a Model to it? ...

When is sql distinct faster than java programming 'distinct'

If I have a sql query that uses 'distinct' (in oracle), would it be faster than retrieving the non-distinct then getting the unique results via java programming? I heard somewhere that oracle sql distinct is heavy, but is it heavier than manual 'distinction' via java programming? Thanks, Franz ...

how to change a column's attribute without affecting the values already present?

Hi, To put it in a nutshell - In an oracle db, I want to make a column varchar2(16) which is now varchar2(8), without affecting the values presnet. I have already tried this and it does weird things. The query I tried was - alter table SOME_TABLE modify (SOME_COL varchar2(16)); But the values(some not all) already present in the table ...

How to update dates stored as varying character formats (PL/SQL)?

Problem: I have a large database table (~500k records) which has a list of dates stored in a varchar2(15) column. These dates are stored in varying formats, ie. some are yyyy-mm-dd, some are mm/dd/yyyy, some are dd/mm/yy, some are mm/dd/yy, etc. Ie: 1994-01-13 01/13/1994 01/13/94 13/01/94 13/01/1994 etc I need to be able to shift thes...

How could be implemented Singleton, which populates its values from db in C# ?

I am trying to implement the Jon Skeet's example public sealed class Singleton { Singleton() { } public static Singleton Instance { get { return Nested.instance; } } class Nested { // Explicit static constructor to tell C# compiler // not to mark type as beforefieldinit ...

Web devs who have made the switch from MySQL, what postgresql features could you now not do without?

I'm contemplating the switch (mainly because of the more permissive license), and tend to hear a lot of Internet murmuring about how much better Postgres is than MySQL, but not many specifics. What do you do in Postgres that make you more productive, or you find elegant? It doesn't have to be fancy, for example some of my favorite thing...

Hibernate mapping a second @Embeddable field in a subclass

I'm trying to map an @Embeddable object in a subclass whose parent class already has a field of that @Embeddable type. The hibernate Embeddable Objects documentation claims I can use the @AttributeOverrides to override the column names of an @Embeddable object: e.g. @Entity public class Person implements Serializable { // Persist...

How to store many years worth of 100 x 25 Hz time-series - Sql Server or timeseries database

I am trying to identify possible methods for storing 100 channels of 25 Hz floating point data. This will result in 78,840,000,000 data-points per year. Ideally all this data would be efficiently available for Web-sites and tools such as Sql Server reporting services. We are aware that relational databases are poor at handling time-ser...

Rails Inheritance with relationships problem.

I am using single table inheritance in my project. Instead of explaining more, I'll give the code: # person_profile.rb class PersonProfile < ActiveRecord::Base belongs_to :Person end # company_profile.rb class CompanyProfile < ActiveRecord::Base belongs_to :Company end # person.rb class Person < User has_one :PersonProfile end ...

Is it possible to have a database trigger on restore in SQL 2005 or 2008

I have some book keeping tasks (reset high water marks, clear some staged data) that need to be done after each restore of a QA database. I know that I can create triggers on databases in SQL but I do not seem to be able to find a way to do it on a database restore. Since I work on a team of people with shared ownership of the database...

Writing a testable "import data from database" class

I am tasked with pulling all the rows from a 3rd party vendor's SQLite data table, creating business objects from those records, and sending the new business objects off to another class. Pseudo-code: var databasePath = "%user profile%\application data\some3rdPartyVendor\vendor.sqlite" var connection = OpenSqliteConnection(databasePath...

In JDBC, when to use Time, Date, and Timestamp

JDBC offers me 3 different datatypes for time-related fields: "Date", "Time" and "Timestamp". Can someone provide a simple summary of what each one is used for and how to choose which to use for a given problem? ...

Naming conventions for tables and columns in database

Hello, Each time when new project starts, I’m thinking about naming conventions of table and columns in database. Which case is your recommendation and why? Case 1. column_name Case 2. ColumnName Case 3. Column_Name Case 4. columnName ...

MS Access AutoNumber on Import

Just curious, when I imported data from a spreadsheet with 519 lines into an empty table, why did my autonumber keys start at 56,557,618? How big can this get? I don't want to end up running out of digits for my primary key field as I didn't even start on the project and I expect to be dumping spreadsheets in quite regularly. ...

Why need 2NF?

Just wondering sometime the 2NF may not be necessary. Option 1. ORDERS {orderId (pk), custId (fk), total, date, status, ...} PARTS {orderId (pk), partsId (pk), qty, unitPrice, description, ...} Option 2. ORDERS {orderId (pk), custId, total, date, status, ...} ORDER_PARTS {orderId (pk)(fk), partsId (pk)(fk), qty, ...} PARTS {pa...

Does anyone have experience using Teiid? Is it as good as it claims?

Recently I have been reading a bit about Teiid: Teiid is a data virtualization system that allows applications to use data from multiple, heterogenous data stores. Teiid is comprised of tools, components and services for creating and executing bi-directional data services. Through abstraction and federation, data is accessed ...