Personally, I'd just write a small program to iterate through a BAM file, writing reads to a new file as I go. It'd be easy enough to just monitor the output file size every X number of added reads and close it/open a new file when it starts getting close to the ideal file size.
Having said that, you and Pierre are absolutely correct. The whole thing is a bad idea.
why on earth do you want to insert a BAM in a database?