Posts

Showing posts from September, 2011

JavaScript 'open' function show 'Error: Invalid argument' in Internet Explorer

JavaScript 'open' function can be used to open a webpage from inside another page. The syntax is : open (url,'name','height','width'); If this function does not work and you get a 'Error: Invalid argument' when using Internet Explorer, check for space in the 'name' argument (eg: 'Prasanth Kumar'). If there is space between the 'name' argument, IE will show this error, but in FireFox it just works fine.

MySQL default value to integer fields with LOAD DATA from CSV file import with dynamic fields

I was confronted with a problem while loading data from file to the MySQL table. The table have some Integer and Varchar fields and the data is loaded from CSV. Normally the data loading process goes well, but in case the data does not exist for a Integer field, the import breaks and show error like :  Incorrect integer value: '' for column 'ID' at row 1 The fields are dynamic that I can determine the fields in run-time only.  So, I devised a solution for this. I have created the query such that for all the fields with Integer type, I add a '0' with it.  Here are the steps.