R:azzak:
Should the statement:
OUTP &vViewFileName
be:
OUTP &vViewFileName APPEND
Otherwise the file will be overwritten every iteration.
Javier,
Javier Valencia, PE
President
Valencia Technology Group, L.L.C.
14315 S. Twilight Ln, Suite #14
Olathe, Kansas 66062-4578
Office (913)829-0888
Fax (913)649-2904
Cell (913)915-3137
================================================
Attention:
The information contained in this message and or attachments is intended
only for the person or entity to which it is addressed and may contain
confidential and/or privileged material. Any review, retransmission,
dissemination or other use of, or taking of any action in reliance upon,
this information by persons or entities other than the intended recipient
is prohibited. If you received this in error, please contact the sender and
delete the material from all system and destroy all copies.
======================================================
-----Original Message-----
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] Behalf Of A. Razzak
Memon
Sent: Monday, October 11, 2004 9:50 PM
To: RBASE-L Mailing List
Subject: [RBASE-L] - Re: unloading views 6.5++ DOS - Razzak's Reply
At 10:29 PM 10/11/2004 -0400, Bernie Lis wrote:
>How can I unload all the views in one database to
>insert into another database (same name)?
Bernie,
Ask and you shall receive!
Here's one way to achieve your goal:
-- Start here ...
-- UnloadViews.RMD
SET VAR vViewName TEXT = NULL
SET VAR vViewFileName TEXT = NULL
DECLARE c1 CURSOR FOR SELECT SYS_TABLE_NAME +
FROM SYS_TABLES +
WHERE SYS_TABLE_TYPE = 'VIEW' ORDER BY SYS_TABLE_NAME
OPEN c1
FETCH c1 INTO +
vViewName INDIC ivViewName
WHILE SQLCODE <> 100 THEN
SET VAR vViewFileName = (.vViewName+'.VIE')
OUTP &vViewFileName
UNLOAD STRUCTURE FOR .vViewName
OUTP SCREEN
FETCH c1 INTO +
vViewName INDIC ivViewName
ENDWHILE
DROP CURSOR c1
CLEAR VAR iv%, vViewName, vViewFileName
RETURN
-- End here ...
DIR *.VIE will give you the list of all unloaded views
and the structure!
Then all you need to do is to copy all *.VIE files in
the same directory as the other database with the same
name, and simply INPUT each file one at a time.
Enjoy and make sure to have fun!
Very Best R:egards,
Razzak.
--- RBASE-L
================================================
TO POST A MESSAGE TO ALL MEMBERS:
Send a plain text email to [EMAIL PROTECTED]
(Don't use any of these words as your Subject:
INTRO, SUBSCRIBE, UNSUBSCRIBE, SEARCH,
REMOVE, SUSPEND, RESUME, DIGEST, RESEND, HELP)
================================================
TO SEE MESSAGE POSTING GUIDELINES:
Send a plain text email to [EMAIL PROTECTED]
In the message SUBJECT, put just one word: INTRO
================================================
TO UNSUBSCRIBE:
Send a plain text email to [EMAIL PROTECTED]
In the message SUBJECT, put just one word: UNSUBSCRIBE
================================================
TO SEARCH ARCHIVES:
Send a plain text email to [EMAIL PROTECTED]
In the message SUBJECT, put just one word: SEARCH-n
(where n is the number of days). In the message body,
place any
text to search for.
================================================