X-SQLT Command-line Processor (xsqlt.exe utility) does not require you to create X-SQLT project file to perform your tasks (although it is a basic mode of usage). It has implemented intelligent parser of command-line arguments, that allows you to pass (as parameters) essential options only. This feature is stated as "inline options".
Calling xsqlt.exe utility with these simplified options is very useful if you want to perform some basic operations, like transforming xml file via xslt template, converting csv file into xml format, extracting database data by simple SQL query, etc.
Syntax:
"Inline options" are defined as a series of command-line parameters (at least two), that represent the combination of source, (X)SQL script, transformation and/or destination.
You do not have to deal with complicated syntax here, because the kind of processing is selected automatically based on the number of command-line parameters, the referenced files existance (if the parameter is an existing file) and based on a few keywords like "xml" or "csv", that correspond to transformation kinds.
This simplified syntax is usually used to handle files, so more specific description could be read as follows:
"Inline options" is a series of command-line parameters (at least two), that represent the combination of source file (or
database connection string), SQL script file (or simple SQL statement),
transformation file (or transformation format specifier) and/or destination file.
See the list of examples below and you will understand the principles quickly.
"Inline options" are intended to process one script only, so there is no support for temporary streams and chaining. This can be done partialy by creating a BAT file with series of xsqlt.exe calls.
If you really want to execute a full featured X-SQLT project inline, use project-source calling convention.
Examples:
-
Transform XML file with XSL template and save result into HTML file.
Note: Source file and template file must exist.xsqlt.exe "C:\Temp\SourceFile.xml" "D:\Temp\Template.xslt" "E:\Temp\DestinationFile.htm"
-
Extract data from database by SQL script, transform them into CSV format and save into destination file.
xsqlt.exe "Provider=VFPOLEDB.1;Data Source=C:\Temp\Database" "C:\Temp\SQLScript.sql" csv "D:\Temp\DestinationFile.csv"
-
Simple file copy.
Note: Source file must exist and destination file must not exist.xsqlt.exe "C:\Temp\SourceFile.txt" "D:\Temp\DestinationFile.txt"
-
Any operation coded in script file will be performed on source file.
Note: Both files must exist.xsqlt.exe "C:\Temp\SourceFile.txt" "D:\Temp\ScriptFile.vbs"
-
Any operation coded in second argument ("VBScript:...") will be performed on source file.
Note: Source file must exist. Script can be written in any of supported scripting languages (VBScript, JScript, JavaScript, pdScript, etc.).xsqlt.exe "C:\Temp\SourceFile.txt" "VBScript:sData = UCase(XSQLT.Source.Text): XSQLT.Destination.Text = sData"
-
SQL script stored in SQLScript.sql file will be executed on the source database.
Note: SQLScript file must exist and it should not have some scripting language suffix (like vbs, js, etc.).xsqlt.exe "Provider=VFPOLEDB.1;Data Source=C:\Temp\Database" "C:\Temp\SQLScript.sql"
-
Any operation coded in script file will be performed on source database.
Note: Script file must exist and it must have some scripting language suffix (like vbs, js, etc.).xsqlt.exe "Provider=VFPOLEDB.1;Data Source=C:\Temp\Database" "D:\Temp\ScriptFile.vbs"
-
Any operation coded in second argument ("VBScript:...") will be performed on source file. Results are expected to be stored into destination file.
Note: Source file must exist. Script can be written in any of supported scripting languages (VBScript, JScript, JavaScript, pdScript, etc.).xsqlt.exe "C:\Temp\SourceFile.txt" "VBScript:sData = UCase(XSQLT.Source.Text): XSQLT.Destination.Text = sData" "D:\Temp\DestinationFile.txt"
See also