Interpolating subroutine call in SQL INSERT INTO SELECT statementby shadowsong (Monk)
|on Aug 26, 2015 at 09:35 UTC||Need Help??|
shadowsong has asked for the wisdom of the Perl Monks concerning the following question:
I am trying to ascertain whether it's possible to include a function call within an SQL insert statement which obtains its values from a select statement.
The SQL statement looks like this:
My script will therefore have something like this
Now, what I'd like to do is to modify COLUMN3 before inserting it into TABLE2 by passing it into a subroutine... but I'm not sure how to go about it (without splitting the INSERT statement into two parts and handling them separately).
What I have below isn't going to work but hopefully it should give you an clear picture of what I'd like to achieve