SaveToDB Framework Functions

SaveToDB Framework Functions

FunctionDescription
xls.get_escaped_parameter_nameThis function returns an escaped parameter name.
xls.get_friendly_column_nameThis function returns a column friendly name.
xls.get_procedure_underlying_tableThis function returns the best underlying table of a procedure.
xls.get_translated_stringThis function returns a translated string.
xls.get_unescaped_parameter_nameThis function returns an unescaped parameter name.
xls.get_view_underlying_tableThis function returns the best underlying table of a view.

xls.get_escaped_parameter_name

This function returns an escaped parameter name.

ParameterDataTypeComment
Resultnvarchar(255)Escaped parameter name
@namenvarchar(128)Column name

The function converts special characters using the _xHHHH_ format, where HHHH is the hexadecimal character code.

For example, it converts a single quote to _x0027_.

You may use such parameter names in the procedures and handlers that get values from the Excel table columns.
The SaveToDB add-in uses the same conversion function to link columns and parameters.

xls.get_friendly_column_name

This function returns a column friendly name.

ParameterDataTypeComment
Resultnvarchar(255)Friendly column name
@namenvarchar(128)Column name

It returns the quoted column name if it is required. Otherwise, it returns the name as is.

xls.get_procedure_underlying_table

This function returns the best underlying table of a procedure.

ParameterDataTypeComment
Resultnvarchar(255)Name of the underlying table
@schemanvarchar(128)Procedure schema
@namenvarchar(128)Procedure name

The code generation procedures use this function to find the underlying table of the procedure used to generate INSERT, UPDATE, and DELETE operations.

The result can be wrong. In this case, specify the underlying table manually.

xls.get_translated_string

This function returns a translated string.

ParameterDataTypeComment
Resultnvarchar(128)The value from the xls.translations table
@stringnvarchar(128)String to translate
@data_languagevarchar(10)Target language

The function uses the xls.translations table to translate strings.

xls.get_unescaped_parameter_name

This function returns an unescaped parameter name.

ParameterDataTypeComment
Resultnvarchar(128)Unescaped column name
@namenvarchar(255)Escaped parameter name

The function converts escaped parameter names with the _xHHHH_ format into the regular column names.

For example, it converts the _x0027_ value to a single quote.

xls.get_view_underlying_table

This function returns the best underlying table of a view.

ParameterDataTypeComment
Resultnvarchar(255)Name of the underlying table
@schemanvarchar(128)View schema
@namenvarchar(128)View name

The code generation procedures use this function to find the underlying table of the view used to generate INSERT, UPDATE, and DELETE operations.

The result can be wrong. In this case, specify the underlying table manually.