Javier,

Did you try the mentioned technique?

If you noticed, the following technique will create
the individual definition based on the view name and
will not overwrite.

Very Best R:egards,

Razzak.


At 10:54 PM 10/11/2004 -0500, Javier Valencia wrote:

R:azzak:
Should the statement:
    OUTP &vViewFileName
be:
    OUTP &vViewFileName APPEND
Otherwise the file will be overwritten every iteration.
Javier,

-----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.



Reply via email to