Re: eseguire una stringa come una query
mi rispondo da solo :S
"Because we can freely assign whatever value we want to @sql_text user variable, we can use this as a device to employ dynamic SQL.
Now we know how to dynamically manipulate our identifiers too: we just manipulate our string before assigning it to the user variable, like so:"
il problema in sostanza è solo che l' execute vuole in ingresso una stringa sua..
set @sql_text:=queryT;
PREPARE stmt1 FROM @sql_text;
EXECUTE stmt1;
DEALLOCATE PREPARE stmt1;
e tutto torna a funzionare ;)
EDIT:
niente.. ho cantato vittoria troppo presto!!! :-(
il trigger ora è questo:
CREATE TRIGGER `db`.aggiornamento_tabelle_insert
AFTER INSERT ON valori_attributo
FOR EACH ROW
BEGIN
CALL `db`.prova(NEW.ID_attributo);
END;
non mi esegue niente, mentre "chiamando la procedura a mano" così:
CALL `db`.prova(26);
funziona tutto..
è una funzionalità non implementata per i trigger di mysql??
la mia versione è: MySQL 5.0.51a-9+lenny2
Edited 1 time(s). Last edit at 08/04/2008 03:42AM by Michele Abbondanza.
Subject
Views
Written By
Posted
5723
April 22, 2008 10:07AM
4864
August 04, 2008 02:08AM
Re: eseguire una stringa come una query
3823
August 04, 2008 03:08AM
Sorry, you can't reply to this topic. It has been closed.
Content reproduced on this site is the property of the respective copyright holders.
It is not reviewed in advance by Oracle and does not necessarily represent the opinion
of Oracle or any other party.