msgpropcount

Description

Extracts and returns the number of properties or attributes in msg_doc from a <msgheader> and <msgproperties> document.

Syntax

msgpropcount_call ::= msgpropcount([msg_doc])
	msg_doc ::= basic_character_expression
	prop_name::= basic_character_expression

Parameters

msgpropcount_call

makes the request to use the msgpropcount function.

msg_doc

is the <msgheader> or <msgproperties> XML document in the form of basic_character_expression. If you do not specify msg_doc, msgpropcount uses the current value of @@msgproperties.

prop_name

is the property name from which you want to extract a value or type in the form of basic_character_expression.

Examples

Example 1

This example assumes that a call from msgrecv returns a message with a single property named trade_name and value of “Acme Maintenance” (“Quick & Safe”). The value of the @@msgproperties global variable is then:

<?xml version='1.0' encoding='UTF-8' standalone='yes' ?>
     <msgproperties 
         trade_name='Acme Maintenance (&quot;Quick &amp; Safe&quot;)'>
     </msgproperties>

The ampersand and the quotation marks surrounding the phrase Quick & Safe are replaced with the XML entities &quot; and &amp;, as required by XML convention.

Retrieves the number of properties from the last message retrieved:

select msgpropcount(@@msgproperties)