Subject | Array types |
---|---|
Author | Paul R. Gardner |
Post date | 2006-06-09T13:13:37Z |
I'm attempting to store a weekly schedule for a shop in a Firebird 1.52
DB.
I have an open and close time each day, as well as a smallint field for
whether the shop is actually open or not that day. Rather than have 21
different fields I thought it would be easier to use an array from
[dayMonday to daySunday] or [1..7].
ALTER TABLE SHOP ADD OPENTIME TIME[1:7];
ALTER TABLE SHOP ADD CLOSETIME TIME[1:7];
ALTER TABLE SHOP ADD CLOSED SMALLINT[1:7];
OK, my fields are there. Now I'm stuck. How can I reference or update
any of this?!
"select opentime[1] from shop" seems to work (although it only returns
NULL with no data).
How do I get data into this field with an update or an insert statement?
Paul Gardner
[Non-text portions of this message have been removed]
DB.
I have an open and close time each day, as well as a smallint field for
whether the shop is actually open or not that day. Rather than have 21
different fields I thought it would be easier to use an array from
[dayMonday to daySunday] or [1..7].
ALTER TABLE SHOP ADD OPENTIME TIME[1:7];
ALTER TABLE SHOP ADD CLOSETIME TIME[1:7];
ALTER TABLE SHOP ADD CLOSED SMALLINT[1:7];
OK, my fields are there. Now I'm stuck. How can I reference or update
any of this?!
"select opentime[1] from shop" seems to work (although it only returns
NULL with no data).
How do I get data into this field with an update or an insert statement?
Paul Gardner
[Non-text portions of this message have been removed]