Thursday, 11th March 2010.

Posted on Monday, 3rd August 2009 by Balazs

One of the common data integrity issues that can happen in a database is the unintended deletion of a row. Here is how to create a DELETE trigger in PostgreSQL.
The example code below assumes you have a “customer_cus” table and a “customer_archive_cua” table with at least two fields. It is a good idea [...]

Share and Enjoy:
  • Print
  • LinkedIn
  • Facebook
  • FriendFeed
  • Twitter
  • Digg
  • Sphinn
  • del.icio.us
  • Mixx
  • Google Bookmarks
  • Slashdot
  • Yahoo! Buzz
  • Yahoo! Bookmarks
  • RSS
  • Ping.fm
  • email
  • PDF

Tags: , , ,
Posted in DB2, Technology | Comments (Comments)

Posted on Tuesday, 27th January 2009 by Balazs

In DB2 if you need to populate a table, you need to use INSERT INTO, like in this example:
INSERT INTO new_table
SELECT col1,col2 FROM source_table
WHERE col1=’something’;

and if you need to populate query variable, you need to use SELECT INTO, like in this example:
SELECT * INTO :var1, :var2, :var3FROM table_name
WHERE col1= ’something’;
Source: DB2 Documentation

Share and Enjoy:

Share and Enjoy:
  • Print
  • LinkedIn
  • Facebook
  • FriendFeed
  • Twitter
  • Digg
  • Sphinn
  • del.icio.us
  • Mixx
  • Google Bookmarks
  • Slashdot
  • Yahoo! Buzz
  • Yahoo! Bookmarks
  • RSS
  • Ping.fm
  • email
  • PDF

Tags: , , , , , , ,
Posted in DB2 | Comments (Comments)

Posted on Saturday, 3rd January 2009 by Balazs

Even though for our core systems we have migrated most databases to DB2, we still have to deal with MySQL for some side systems, such as CRM, Blog, etc.   One of the MySQL features that I recently noticed is that dropping indexes on sizable tables takes forever.  That is apparently due to a convoluted [...]

Share and Enjoy:
  • Print
  • LinkedIn
  • Facebook
  • FriendFeed
  • Twitter
  • Digg
  • Sphinn
  • del.icio.us
  • Mixx
  • Google Bookmarks
  • Slashdot
  • Yahoo! Buzz
  • Yahoo! Bookmarks
  • RSS
  • Ping.fm
  • email
  • PDF

Tags: , , ,
Posted in Technology | Comments (Comments)

Posted on Wednesday, 15th October 2008 by Balazs

Many drivers have ways to escape SQL strings to make sure no malicious activity is going on.  Usually you can use a function in the driver that can take care of that.  However, if all you need is too escape a single quote, you can also use the double quote method: 
reliability is key to gain [...]

Share and Enjoy:
  • Print
  • LinkedIn
  • Facebook
  • FriendFeed
  • Twitter
  • Digg
  • Sphinn
  • del.icio.us
  • Mixx
  • Google Bookmarks
  • Slashdot
  • Yahoo! Buzz
  • Yahoo! Bookmarks
  • RSS
  • Ping.fm
  • email
  • PDF

Tags: , , ,
Posted in DB2 | Comments (Comments)