manish singh wrote:
> ...
> so considering the process i mentioned above,
> what do you guys think
> is it a good enough process? i mean we will
> eventually move maybe a couple hundred
> tables from the 3 oracle databases( not everything
> is required) .
>
Writing a set of batch SQL scripts can work, but your QA and
debugging of this process needs to be done outside of the scripts
themselves. If what you want to know is to guarantee that the
entire process ran without SQL errors, then mysql client by default
will stop on the first SQL error, so that is easy enough.
But if you want to do things like make sure no data conversion errors
occured due to column type mismatch, there will not be much
help for you here. If you use LOAD DATA INFILE, it will tell
you how many warnings there were, so you could just check
to make sure the output from that showed 0 errors after you
are done to verify that there were no data conversion issues.
> in the test system i created for one table , i
> did the data transformation for the particular
> fields in my sql query itself. is there a way
> mysql can help me here
> does it have any process that can do data
> transformation for me automatically?
MySQL will do data conversion automatically if the data does
not fit into a field of a certain type, for example a string will
become 0 if inserted into a numeric field. MySQL 5.x I believe
will be offering a strict mode that will throw errors instead of
doing implicit data conversion which might be something that you
want here.
> and error handling, as iam just using SQL
> scripts iam not able to conjure up a design
> which would help me trap errors thrown by mysql
> and maybe display them or create a log file which
> would maybe mailed to the concerned people later
>
To trap errors on the fly, you should really do this programmatically,
then you could do things like check return values from SQL
statement executions, log warnings and so on. This gets back
to scripting an ETL process in Java JDBC or Perl DBI for example.
Regards,
Josh
Josh Chamas
Director, Professional Services
MySQL Inc., www.mysql.com
Get More with MySQL!
http://www.mysql.com/consulting