Subject | Re: [ib-support] SQL questions |
---|---|
Author | Svein Erling Tysvær |
Post date | 2001-06-28T07:58:09Z |
2 - Use Fabrice suggestion or simply
SELECT C.COUNTRY_NAME,
D.CURRENCY_NAME AS CURRENCYNAME1,
E.CURRENCY_NAME AS CURRENCYNAME2
FROM COUNTRIES C
JOIN CURRENCIES D ON C.CURRENCY1=D.ID
JOIN CURRENCIES E ON C.CURRENCY2=E.ID
4 - I think you've got several options. One being getting a value from a
generator, set the value of col2 to this value, insert into table1 all
instances with col2 having this value and then set the value of col2 back
to 1 for records having this value. Another option may be to make sure both
queries happen within the same transaction and make sure you use the
correct transaction isolation. But others will have to tell you what the
correct transaction isolation is in this case (snapshot?) and if it will
have major drawbacks.
Set
SELECT C.COUNTRY_NAME,
D.CURRENCY_NAME AS CURRENCYNAME1,
E.CURRENCY_NAME AS CURRENCYNAME2
FROM COUNTRIES C
JOIN CURRENCIES D ON C.CURRENCY1=D.ID
JOIN CURRENCIES E ON C.CURRENCY2=E.ID
4 - I think you've got several options. One being getting a value from a
generator, set the value of col2 to this value, insert into table1 all
instances with col2 having this value and then set the value of col2 back
to 1 for records having this value. Another option may be to make sure both
queries happen within the same transaction and make sure you use the
correct transaction isolation. But others will have to tell you what the
correct transaction isolation is in this case (snapshot?) and if it will
have major drawbacks.
Set