Progress
Version 9
Product Update Bulletin


QUOTER Function

Interface
OS
Speedscript
All
All
Yes

Converts the specified data type to CHARACTER and encloses the results in quotes when necessary.

The QUOTER function is intended for use in QUERY-PREPARE where a character predicate must be created from a concatenated list of string variables to form a WHERE clause. In order to process variables, screen values, and input values so that they are suitable for a query WHERE clause, it is often necessary to enclose them in quotes. For example, European-format decimals and character variables must always be enclosed in quotes. You can use the QUOTER function to meet that requirement.

The QUOTER function has the following syntax:

SYNTAX

QUOTER (<expression> [, <quote-char> [ , <null-string> ]]) 

expression

An expression in the data type that you want to convert to character and enclose with quotes.

quote-char

Either a single or double quote, enclosed in the opposite: "'" or '"'. The default is double quote. Passing ? for this argument results in double quotes.

null-string

The string you want for UNKNOWN: the word NULL or "" for example. The default is an unquoted ? character.

For example, the following:

 DEFINE VARIABLE mychar As CHARACTER INITIAL "Lift Line Skiing". 
     ….. 
     qhandle:QUERY-PREPARE( "FOR EACH customer WHERE name = "  + 
QUOTER(mychar)) 

Would produce this prepare-string:

FOR EACH customer WHERE name = "Lift Line Skiing". 

NOTES


Copyright © 2004 Progress Software Corporation
www.progress.com
Voice: (781) 280-4000
Fax: (781) 280-4095