me,myself,english and programming..

Archive for the ‘SQL/ETL’ Category

How To Export CSV to MySQL using Pentaho

Sunday, January 18th, 2009

There are so may ways to populate your CSV file into MySQL table. Today I will share how to do this task easily with Pentaho.

Previously I upload the csv file containing malaysia postcode here hence I will use this file as my sample for this tutorial.

1. Create new transformation (I’m assuming that you know how to open up this application)

2009-01-18 101430

2. Drag CSV file input to Transformation area

2009-01-18 101516

(more…)

Pentaho – Error working with XUL definition Solution

Friday, November 28th, 2008

Previously I blog about Pentaho and succesfully run it in my ubuntu 8.04 box. After a while, I upgrade my pc to ubuntu 8.10 and my pentaho is not working properly. I got below error while trying to create a new database connection.

PentahoError

org.pentaho.ui.xul.XulException:java.lang.NullPointer Exception

Solution for this error is pretty much easy but it take me a while to figure it out.

(more…)

Data migration with ETL Tool

Friday, November 21st, 2008

Data migration is the process of importing legacy data to a new system. It is a routine part of IT operations in today’s business environment.

Common Data Migration Scenarios :
* Mergers and acquisitions
* Legacy system modernization
* Enterprise application consolidation, implementation, or upgrade, such as an SAP ERP or CRM implementation
* Master data management implementation
* Business process outsourcing

Here I show you how ETL tool can help to speed up the data migration process using Advantage Data Transformer as my tool. You can’t find much information about this product in fact,I don’t know who on earth is using this product beside me. Although it is not popular compared to DataStage or Informatica but it help me a lot. It just enought. :)

Most of the thing is drag and drop.easy right. :)

etl sample

(more…)

Shedule your SQL Query using SQL Query Analyzer

Monday, November 17th, 2008

I don’t know if someone else want to know about this but hey, sharing is caring right. :)

Declare @dateTimeToWait as DATETIME
Set @dateTimeToWait = '2020-11-11 15:02:43.000  '

While (1=1)
BEGIN
 IF getdate() > @dateTimeToWait Break
 -- Sleep for 30 seconds
 WAITFOR DELAY '00:00:30'
END
-- ADD YOUR SQL HERE
Print 'your SQL query goes here'

Till then….adios.

MSSQL – Useful query for my reference

Friday, November 7th, 2008

This will me my reference of SQL statement. I will update this post if I find anything that I feel useful for me..and for you. :)

1. Check for temporary table and Drop table if exist.

IF object_id('tempdb..#myTempTable') IS NOT NULL drop table #myTempTable

2. Convert SQL string to HEX

select CONVERT(varbinary(100),'select getdate() as MyDateInHex')

(more…)