G'day,
The following procedure works very well for me in a development
environment and after deployment.
After a discussion on the list some years back I took on
board the suggestion of storing all my views in a command
file to be called:
a. straight after a structure change of the database,
b. automatically whenever an update file is distributed to my end users,
c. by a menu option in the Utilities section of my Database Administration
Module,
d. whenever else required.
I have a file called BM_View.app
In it there are several blocks partly reproduced here.
The block BuildVws has as its first cmd the call to set all
variables required by views so there are never problems due
to them not being set.
$COMMAND
BM_Views
-- This file drops and rebuilds views so they do not have to be modified
-- manually after table modifications.
-- Copyright 1997-2002 by Tom Grimshaw ALL RIGHTS RESERVED
-- PO Box 470 Glebe NSW 2037 Australia
-- tel 02 9552 3311
-- fax 02 9566 2164
-- e-mail [EMAIL PROTECTED]
-- Created by Tom Grimshaw 15-12-1997
-- Modification history
-- 13-03-2001 tlg Surrounded WHERE clauses containing var in parens
-- 07-08-2001 tlg Added wait message
--
SET ESCAPE ON
SET ERROR MESSAGES OFF
SET MESSAGES OFF
-- Turn on wait message
RUN WaitMsg IN GlobBlok.apx
RUN DropView IN BM_Views.apx
RUN BuildVws IN BM_Views.apx
-- Turn off wait message
RUN WaitMOff IN GlobBlok.apx
RETURN
$COMMAND
DropView
-- Drops views in database
-- Called by:
-- BM_Views in BM_Views.apx
*( Requires var - none
Returns var - none
)
-- Created by Tom Grimshaw 10-07-2001
-- Modification history
--
-- BizMan specific views
DROP VIEW TempPromo
DROP VIEW VW_Acc_Pay_Unpaid
DROP VIEW VW_AcPay_Aloc_Chq
DROP VIEW VW_Addresses_Types
DROP VIEW VW_AgeMktgAnalysis
...
...
RETURN
$COMMAND
BuildVws
-- Builds views allowed by BMModules
-- Called by:
-- BM_Views in BM_Views.apx
*( Requires var - none
Returns var - none
)
-- Created by Tom Grimshaw 10-07-2001
-- Modification history
--
-- Set variables section
-- Added code to rebuild views in batch lots as got error message
--'Dynamic table limit exceeded. All users must disconnect to reset it.'
-- after 100th view
RUN ViewsVar IN BM_Views.apx
RUN VwVarSV IN BM_Views.apx
RUN FrstView IN BM_Views.apx
...
...
RETURN
At 10:10 23/02/02 -0500, you wrote:
>Unfortunately when you do a database UNLOAD/BACKUP the order
>in which views are unload doesn't follow an acceptable patten
>to prevent your problem under all circumstances. They aren't
>unloaded in the "SYS_TABLE_ID" of SYS_TABLES order or in
>the "SYS_TABLE_NAME" order of SYS_TABLES it appears that
>they are unload in the order the view appears in SYS_VIEWS.
> The order that views in SYS_VIEWS appear to be a function
>of SYS_TABLE_ID from an initial load of the VIEWS which is
Warmest regards,
Tom Grimshaw
coy: Just For You Software
tel: 612 9552 3311
fax: 612 9566 2164
mobile: 0414 675 903
post: PO Box 470 Glebe NSW 2037 Australia
street: 3/66 Wentworth Park Rd Glebe NSW 2037
email: [EMAIL PROTECTED]
web: www.just4usoftware.com.au
This email and any files transmitted with it are confidential to the
intended recipient and may be privileged. If you have received this email
inadvertently or you are not the intended recipient, you may not
disseminate, distribute, copy or in any way rely on it. Further, you should
notify the sender immediately and delete the email from your computer.
Whilst we have taken precautions to alert us to the presence of computer
viruses, we cannot guarantee that this email and any files transmitted with
it are free from such viruses.
================================================
TO SEE MESSAGE POSTING GUIDELINES:
Send a plain text email to [EMAIL PROTECTED]
In the message body, put just two words: INTRO rbase-l
================================================
TO UNSUBSCRIBE: send a plain text email to [EMAIL PROTECTED]
In the message body, put just two words: UNSUBSCRIBE rbase-l
================================================
TO SEARCH ARCHIVES:
http://www.mail-archive.com/rbase-l%40sonetmail.com/