Spain does not have much in the way of official oath to the flag ceremonies, that some other countries ascribe to.
"Jura de Bandera" was the oath sworn to the Spanish flag by conscripts at the end of military service. Compulsory military service was abolished in Spain in 2001.
Any Spaniard could request to attend the ceremony and take part in the oath. Citizens in Spain are not otherwise sworn in to the flag.
The national anthem (a Prussian piece called "Marcha Granadera" or Grenadier March, a gift from King Frederick the Great to King Charles III) is usually played -but not necessarily- when the flag is present and/or raised/lowered.
There are no current official lyrics for the national anthem.
The Flag of Spain