Database file import into M-Files¶
Availability
Module |
Release# |
---|---|
Integration |
3.1.5.41 |
The Mfsql_File_Unique_Ref property is automatically added to the vault when the content package is installed during the installation routine.
The folder on the SQL Server to be used as the temporary file export folder is automatically created during the installation routine as c:MFSQLFileImport.
Parameters
Type |
Description |
---|---|
Procedure Name |
|
Inputs |
Debug: 1 = Debug Mode; 0 = No Debug (default) |
Outputs |
1 = success |
Review the folder location for the file import
SELECT * FROM mfsettings WHERE name = 'FileTransferLocation'
Execute Procedure
-------------------------------------------------------------------------------------------------------------------------
exec spMFCreateTable 'Drawing'
exec spmfupdatetable 'MFDrawing',1
select * from MFDrawing
-------Add New File to existing object -----------------------
update MFDrawing set Process_id=5 where fileobjectid='1'
--in this example to ImageFiles view containts the extract of the files to be imported
EXEC SynchronizeFilesToMFiles 'ImageFiles','ID','FileName','File','Drawing',500
select * from ImageFiles
-----------------Over write File-----------------------
exec spmfupdatetable 'MFOrder',1
update MFDrawing set Process_id=5 where fileobjectid='6'
EXEC SynchronizeFilesToMFiles 'ImageFiles','ID','FileName','File','Drawing',500
-------------------------------Adding File to MultiFile Document-----------------------
update MFDrawing set process_id=5 where fileobjectid='2'
EXEC SynchronizeFilesToMFiles 'ImageFiles','ID','FileName','File','Drawing',500
Use Cases(s)