function::user_string_quoted_utf16 - Linux


Overview

The user_string_quoted_utf16 function creates a quoted user string holding UTF-16 encoded data. The function can be used for inserting UTF-16 strings into string types.

Syntax

function::user_string_quoted_utf16(input_string AS STRING) -> STRING

Options/Flags

None.

Examples

-- Example 1: Creating a quoted user string with UTF-16 data
SELECT function::user_string_quoted_utf16('\u0041') AS utf16_string;
-- Output: '"\u0041"'

-- Example 2: Using the UTF-16 string in a query
SELECT * FROM table_name WHERE name = function::user_string_quoted_utf16('\u0041');

Common Issues

Error: Invalid UTF-16 data

This error occurs when the input string contains invalid UTF-16 data. Ensure that the input string is properly encoded in UTF-16 format.

Error: Out of memory

This error occurs when the system runs out of memory while processing the input string. Try reducing the size of the input string or freeing up memory in your system.

Integration

The user_string_quoted_utf16 function can be combined with other functions and commands for advanced tasks, such as:

  • Inserting UTF-16 strings into database tables using the INSERT statement.
  • Passing UTF-16 data to external procedures or functions through the CALL statement.

Related Commands

  • user_string: Converts a string to a user string.
  • user_string_quoted: Creates a quoted user string holding data.
  • user_string_quoted_binary: Creates a quoted user string holding binary data.