Let's take an example sql file 1.sql, which contains only one line :
# cat 1.sql
CREATE BITMAP INDEX "USER"."xxx_A_xxx_xxx_xxx_ELEMENT_" ON "USER"."A_USER-2004" ("XXX")
We need to replace _ELEMENT_ to number value. Here is one of the ways to do it :
#
sed "s/_ELEMENT_/_$RANDOM/ ; s/.*/echo '&'/e" 1.sql
CREATE BITMAP INDEX "USER"."xxx_A_xxx_xxx_xxx_27237" ON "USER"."A_USER-2004" ("XXX")
Good Luck !
P.S. It seems the sed's info page is quite misleading about substitution flag /e... ;-)