in reply to Unable to enter long sql commands

I'm not familiar with buffer length issues but you could try to write this in a file and execute it from there.