29 December 2010

But when we try to run this insert query through PHP application, where we don't know whether the variable is NULL or contain some value, it starts giving error. Here we need to do some programming and query manipulation as shown below,

Same as CONCAT_WS function, the above query will ignore fields which are having NULL values, and return the concatenation of remaining fields. But if your fields contains blank value, modify the above query as given below, to get the proper result

18 December 2010

To migrate data from Access to PostgreSQL, so many tools are available online. I did try to migrate data with few tools, but no success. I encounter issues with the tables which has boolean fields and with the tables in which access date() and time() function are being used to set default value of a column.

The best way to migrate data from Access to PostgreSQL database, I found is through PostgreSQL ODBC driver. To check how to install and setup PostgreSQL ODBC driver go to Install & Setup PostgreSQL ODBC Driver . Once finished with installation and setup of PostgreSQL ODBC driver, you are ready to migrate the data.

How to migrate data from Access to PostgreSQL using PostgreSQL ODBC?

Open the access database, select the table, then click on file, Save As/Export, a “Save As” popup will appear, select “To an external file or database” radio button and click ok.

Then in the new popup for “Save as type” select “ODBC database”.

An Export window will appear, change the table name if required, or just click ok.

“Select Data Source” window will appear, select your PostgreSQL DSN, that you have created as mentioned above. And click ok.

15 December 2010

Download the latest PostgreSQL 32-bit ODBC Driver by choosing a mirror from http://wwwmaster.postgresql.org/download/mirrors-ftpand then navigating to the odbc/versions/msi/ folder. The current version is psqlodbc_08_03_0100.zip which was released Jan-22-2008.

Unzip psqlodbc_08_03_0100.zip

Run the psqlodbc.msi file

Setup PostgreSQL ODBC Driver

Click Start, Control Panel, then switch the control panel to “Classical View”, if it's already not in classical view or select "System and Security" category.