Is there a way in SQL to perform a function when data is input into a table. So not calling a function but on new insert the input data is put through if and elses to change the data depending on the if else requirements?
Hi, You didn't mention which DB you're going to use but create trigger maybe helps. Regards, Nick p.p.: Before Insert event.
well i think you can use the insert select statement, in mysql reference http://dev.mysql.com/doc/refman/4.1/en/insert-select.html try something like this INSERT INTO tbl_name (col_name1, col_name2) SELECT CASE WHEN (any condition) THEN (any statement) ELSE (other statement) END AS col_value1, col_value2 Code (markup): note: you can use select statement without select any table for example SELECT 1 Code (markup): , will return row set 1 hope it works.