SQLWrap is a plugin for RLwrap that adds TAB completion for SQL scripts and commands to Oracle SQL*Plus.
SQLWrap github page
SQLWrap to the rescue - blogpost