COMPILE ROUTINE MOVE_DATA_VOL(Dummy)
ROWDEF(CHARSTR)

DECLARE SUBROUTINE obj_Schedule, RList,Send_Dyn, Copy_Table, Define_Database, ErrMsg, Set_Status, Rename_Table
DECLARE SUBROUTINE Delete_Index, Create_Index, Attach_Table, Delete_Table
DECLARE FUNCTION Get_Status,Security_Check,Utility

$insert Logical

equ BTREETYPE$ to 1

Delete_Index('EXPORTS', 'ENTRY_ID', BTREETYPE$)
Delete_Index('EXPORTS', 'SHARABLE', BTREETYPE$)

Status = ''
Rename_Table( 'EXPORTS', @DBID, 'O_EXPORTS',1, Status )

IF Get_Status(errCode) THEN
	
	*GOTO Bail
END

Set_Status(0)

Rename_Table( 'LISTBOX_CONFIG', @DBID, 'O_LISTBOX_CONFIG', 1, Status )

IF Get_Status(errCode) THEN

	*GOTO Bail
END

Set_Status(0)

LockFlag		= 0
DeleteFlag		= 0
OverWriteFlag	= 1
ExistsFlag		= 0
CopyStatus		= ''

Copy_Table('O_EXPORTS','LSL','LSL2','EXPORTS',LockFlag,DeleteFlag,OverWriteFlag,ExistsFlag,CopyStatus,0)
IF Get_Status(errCode) THEN

	*GOTO Bail
END

Set_Status(0)

Copy_Table('O_LISTBOX_CONFIG','LSL','LSL2','LISTBOX_CONFIG',LockFlag,DeleteFlag,OverWriteFlag,ExistsFlag,CopyStatus,0)
IF Get_Status(errCode) THEN

	*GOTO Bail
END

Attach_Table('LSL','','','')

Create_Index(BTREETYPE$,'EXPORTS', 'ENTRY_ID', 0, 1) 
Create_Index(BTREETYPE$,'EXPORTS', 'SHARABLE', 0, 1)


Delete_Table('O_EXPORTS',0,Status)
IF Get_Status(errCode) THEN

	*GOTO Bail
END

Delete_Table('O_LISTBOX_CONFIG',0,Status)
IF Get_Status(errCode) THEN

	*GOTO Bail
END

Set_Status(FALSE$)
Define_Database(@dbid, TRUE$, "", "")
if Get_Status(Error) then
	Set_Status(FALSE$)
	* handle the error here
end



* * * * * * *
Bail:
* * * * * * *

RETURN
