Top

Name

http_url — write to HTTP client or string output stream with URL escapes

Synopsis

http_url ( in val_expr any ,
  in tag varchar ,
  in stream any );
 

Description

The http_url is used to write to an HTTP client (when in a VSP context) or a specified string output stream. http_url uses URL escapes for special characters.

Parameters

val_expr

A value expression. May be any scalar expression. If val_expr is an XML entity, a serialization of the entity is written to the stream . This is not the XML as a text string, but a serialization of the internal representation of parsed XML data.

tag

Optional. If present and is a string, the output will be enclosed in tags named by the string content of tag . If the expression evaluates to 0 or null, it will be ignored.

stream

Optional parameter. If omitted or is 0 and the function is executed within VSP context, the val_expr will be written to the HTTP client. If present and non-zero, val_expr will be written to the specified stream. If non-zero, the value must be a valid stream obtained from function string_output

Return Values

None

Errors

Table 24.45. Errors signalled by http_url

SQLState Error Code Error Text Description
37000 HT006 http output function outside of http context and no stream specified: %s  
22023 SR066 Unsupported case in CONVERT (%s -> VARCHAR)  

Examples

Example 24.182. HTTP output

Output of various flavours of http . See string_output and string_output_string for examples how to use http to write to streams other than the HTTP output.

http (' % <b>')     ' <b>
http_value (' % <b>')   % &lt;b&gt;
http_url (' % <b>')  +%25+<b>
http_value (12, 'li')  <li>12</li>