Name

VAD_LOAD_SQL_FILE — Loads SQL file and executes its content's statements.

Synopsis

DB.DBA. VAD_LOAD_SQL_FILE ( in sql_file_name varchar ,
in grouping integer ,
in report_errors varchar ,
in is_dav integer );

Description

Loads SQL file ( can be regular file or DAV resource ) and then splits its content into single statements and executes them one by one. Along the process, the function makes needed reports and changes 'VAD_errcount' registry variable.

Parameters

sql_file_name

For files, this parameter is either absolute or relative to server's working directory. The directory should be readable according to the virtuoso.ini settings. For DAV resources, the sql_file_name is always absolute: ('/DAV/<folder-name>...').

grouping

Always set this parameter to 1.

report_errors

The supported values for this parameter are:

  • 'report' - to log errors and continue or:

  • 'signal' - at the very first error, break the loading and resignal it.

is_dav

This parameter is 0 for plain file and 1 for resource loaded in DAV.

Examples

Example24.437.Simple Use

DB.DBA.VAD_LOAD_SQL_FILE ('./conductor/vdir_helper.sql', 1, 'report', 0);