in reply to regular expression to get the tablename.column_name

Trying to condense the code to a single line is really only useful only for satisfying curiosity, as code that is condensed like that is harder to maintain.

That said, here's one line of perl for it:

perl -ne '/^TABLE;([^;\n]+)/ && ($table = $1) or /^COLUMN;([^;\n]+)/ & +& print "$table.$1\n"' data.txt
And here's an awk solution
awk -F ';' '/^TABLE/ {table=$2} /^COLUMN/ {printf("%s.%s\n",table,$2) + }' data.txt