The National Education Union's Wales secretary, Nicola Fitzpatrick, said there was no place for violence in schools, and that there needed to be "a wider public health approach to tackling youth violence".
"Young people are growing up in very challenging times, the impact of Covid and cost of living crisis, alongside the readily available access to harmful and age-inappropriate content on social media and online forums are all taking their toll."
Dyfed Powys Police's Det Ch Supt Ross Evans said: "School should be a safe place, a sanctuary for the pupils that attend it, and weapons have no place within their grounds.
"We will not tolerate any attempt to compromise the safety of children or staff."
Michael Cray, of the Crown Prosecution Service, described it as a "terrifying incident" for the victims and those who witnessed it, acknowledging the "bravery of the staff and pupils" at the school.
Carmarthenshire council leader Darren Price said the incident "shocked and appalled the communities of Carmarthenshire and beyond".
"Violence, in any form, has unequivocally no place within our schools or any aspect of society."
The Welsh government said any form of "violence or abuse against staff in our schools is completely unacceptable", adding that "schools can take immediate and permanent action to expel any pupil in possession of a weapon".