Some questions about views
Posted in 2005
Background:
Michelle made this change to the webtodev database yesterday:
Alter table to_recipient add (
fr_fee_reduction MONEY(16,2) default 0 not null before source_flag,
fr_explanation VARCHAR(255) before source_flag,fr_operator_id VARCHAR(30) before source_flag);
After she did this, the v_to_recipient view started returning syntax errors
when queries were run against it.
She then changed the view to add these 3 new fields.
The syntax errors continued.
When I checked the sysviews table to see what Informix had stored, I
discovered that some of the lines containing the FROM clause did not appear to
have spaces in them any longer:
EX : line n:
outer (transcript_purpose ß no space at the end
Line n+1: x4
ß no space at the beginning either
So the resulting query would read like FROM
transcript_purposex4
- which
I think was the cause of the syntax errors
When I dropped and re-created the view, the lines in the sysviews changed
and were cut off in different places. And the syntax errors went away.
Questions:
Does Informix regenerate the sysviews rows for a view when a table of the view
is altered?
Does Informix account for spaces when putting the sysviews rows back together
for a view?
Is a view cached and not re-read from sysviews until a certain event happens?
What could have caused the view to be corrupted?
FYI
I found the following vague statement at
http://database.sarang.net/database/informix/book/informix-sql/01alter.fm.html#1
25738
Altering a table on which a view depends might invalidate the view.
Thanks,
floyd