Subject | Which COMPUTED BY queries are safe for backup/restore? |
---|---|
Author | Raymond Kennington |
Post date | 2003-07-14T14:08:03Z |
Suppose I have a lookup table for city, state, zip:
CREATE TABLE Zip:
ID INTEGER
City VARCHAR(n)
State VARCHAR(n)
Zip VARCHAR(n)
and a table of names and addresses with a lookup into the Zip table:
CREATE TABLE Person
FirstName VARCHAR(50)
...
ZipID INTEGER
City COMPUTED BY ((SELECT Zip.City FROM Zip WHERE Zip.ID = Person.ZipID))
Is it ok to have a COMPUTED BY field for City in the Person TABLE as shown
above?
Will gbak/restore function correctly with this structure?
Would it make a different if instead of defining it in the CREATE of the table
it were defined in an ALTER statement?
ALTER TABLE Person
ADD
City COMPUTED BY ((SELECT Zip.City FROM Zip WHERE Zip.ID = Person.ZipID))
--
Raymond Kennington
Programming Solutions
TeamW2W (InfoPower)
CREATE TABLE Zip:
ID INTEGER
City VARCHAR(n)
State VARCHAR(n)
Zip VARCHAR(n)
and a table of names and addresses with a lookup into the Zip table:
CREATE TABLE Person
FirstName VARCHAR(50)
...
ZipID INTEGER
City COMPUTED BY ((SELECT Zip.City FROM Zip WHERE Zip.ID = Person.ZipID))
Is it ok to have a COMPUTED BY field for City in the Person TABLE as shown
above?
Will gbak/restore function correctly with this structure?
Would it make a different if instead of defining it in the CREATE of the table
it were defined in an ALTER statement?
ALTER TABLE Person
ADD
City COMPUTED BY ((SELECT Zip.City FROM Zip WHERE Zip.ID = Person.ZipID))
--
Raymond Kennington
Programming Solutions
TeamW2W (InfoPower)