Tag Archives: SQL

Creating Delete Triggers in PostgreSQL

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 … Continue reading

Share and Enjoy:
  • Print
  • Digg
  • del.icio.us
  • Facebook
  • Google Bookmarks
  • Blogplay
  • email
  • LinkedIn
  • PDF
  • Ping.fm
  • RSS
  • Slashdot
  • Twitter
Posted in DB2 | Tagged , , , | View Comments

DB2 INSERT INTO vs SELECT INTO

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 … Continue reading

Share and Enjoy:
  • Print
  • Digg
  • del.icio.us
  • Facebook
  • Google Bookmarks
  • Blogplay
  • email
  • LinkedIn
  • PDF
  • Ping.fm
  • RSS
  • Slashdot
  • Twitter
Posted in DB2 | Tagged , , , , , , , | View Comments

Drop Index in MySQL takes forever

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 … Continue reading

Share and Enjoy:
  • Print
  • Digg
  • del.icio.us
  • Facebook
  • Google Bookmarks
  • Blogplay
  • email
  • LinkedIn
  • PDF
  • Ping.fm
  • RSS
  • Slashdot
  • Twitter
Posted in Uncategorized | Tagged , , , | View Comments

Escape SQL apostrophe

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 … Continue reading

Share and Enjoy:
  • Print
  • Digg
  • del.icio.us
  • Facebook
  • Google Bookmarks
  • Blogplay
  • email
  • LinkedIn
  • PDF
  • Ping.fm
  • RSS
  • Slashdot
  • Twitter
Posted in DB2 | Tagged , , , | View Comments