If I CREATE VARIABLE foo INT DEFAULT 5 it will always be 5 until I do a
SET, but the SET foo = 6; is only scoped to the session.
So, its actually not a big deal for my current application because the
variable (a start date for new business rules) should be a constant, and
I'm only going to change it in QA. If the business rules get delayed, then
a CREATE/DROP is fine. However, what if I had a variable that was a counter
of some kind? What if I expected some job to be constantly changing the
value of a global variable and several other jobs to be periodically SELECT
SCHEMA.VARIABLE FROM SYSIBM.SYSDUMY1? Is DROP/CREATE in a transaction the
appropriate behavior? Is there a risk that the SELECT might occur when the
variable doesn't exist?
This mailing list archive is Copyright 1997-2019 by midrange.com and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available on our policy page. If you have questions about this, please contact