Open Source RDBMS - Seamless, Scalable, Stable and Free

한국어 | Login |Register

Versions available for this page: CUBRID 8.4.3 |  CUBRID 9.0.0 | 

cci_escape_string

Description

Converts the input string to a string that can be used in the CUBRID query. The following parameters are specified in this function: connection handle or no_backslash_escapes setting value, output string pointer, input string pointer, the length of the input string, and the address of the T_CCI_ERROR struct variable.

When the system parameter no_backslash_escapes의 is yes (default) or when the CCI_NO_BACKSLASH_ESCAPES_TRUE value is sent to the connection handle location, the string is converted to the following characters.

  • ' (single quote) => ' + ' (escaped single quote)

When the system parameter no_backslash_escapes의 is no or when the CCI_NO_BACKSLASH_ESCAPES_FALSE value is sent to the connection handle location, the string is converted to the following characters:

  • (new line character, ASCII 10) => + n (backslash + Alphabet n)
  • (carrage return, ASCII 13) => + r (backslash + Alphabet r)
  • 0 (ASCII 0) => + 0 (backslash + 0(ASCII 48)
  •  (backslash) => +

You can assign the space where the result string will be saved by using the length parameter. It will take as much as the byte length of the maximum input string * 2 + 1.

Syntax

long cci_escape_string(int conn_handle, char *to, const char *from, unsigned long length, T_CCI_ERROR *err_buf)

  • conn_handle: (IN) connection handle or no_backslash_escapes setting value. When a connection handle is given, the no_backslash_escapes parameter value is read to determine how to convert. Instead of the connection handle, CCI_NO_BACKSLASH_ESCAPES_TRUE or CCI_NO_BACKSLASH_ESCAPES_FALSE value can be sent to determine how to convert.
  • to: (OUT) Result string
  • from: (IN) Input string
  • length: (IN) Maximum byte length of the input string
  • err_buf: (OUT) Database error buffer
Return Value
  • Success: Byte length of the changed string
  • Failure: Error Code
Error Code
  • CCI_ER_CON_HANDLE
  • CCI_ER_COMMUNICATION