That will only work if the drive is a rewritable drive. Only those drives have the erase function. Rewriting is only possible with RW media (contains a special layer that can be erased), but using that media won't let you rewrite the disks if it is not performed on a rewritable drive. From what I could research, it doesn't look like the drives you mentioned are rewritable drives, but if they are, they will have the "compact Disc ReWritable" logo on the drawer.
BTW, rewritable disks are not a good substitute for a pen drive. You can reuse the disk, but only a limited number of times. They aren't designed for constant rewriting. They are more appropriate for something like a rolling backup, where the content gets replaced over time, maybe a number of times, but not on a continuous basis for the same area of the disk.
Actually, pen drives are not a good substitute, either, for a hard disk for an "active" memory process. The simple flash memory configuration used in them is designed for "storage" type reuse, not active, repetitive writing. Their life can be as low as a few thousand write cycles, which can last a very long time if it is used for the appropriate application. SSDs don't suffer from the same limitation (they are not just a collection of flash memory, they are designed to be used like a hard disk).