Documentation
Back to website >

SqlString (Pascalscript)

Description

Converts a simple Pascal string into an SQL string. It contains a single quotation mark at the beginning and at the end. Since Pascal also uses these characters to represent a string, this conversion helps to pass the quotes correctly.

Syntax

function SqlString(const S : string): string;

Arguments

The string specified in S is supplemented by two individual quotation marks, which are placed at the beginning and end of the string respectively.

Example

begin
  ShowMessage('This is '+SqlString('TEST')+' a test');
end;

Rules to understand the script can be found here.

The text passed in SqlString is supplemented by two single quotation marks.

ShowMessage shows for example: This is 'TEST' a test