Extracts and returns from a <msgheader> and <msgproperties> document the message provider’s property type for the msg_doc property with a name that equals prop_name. The result is a null value if msg_doc does not have a property with a name is equal to prop_name.
msgproptype_call ::= msgproptype(prop_name [ , msg_doc]) msg_doc ::= basic_character_expression prop_name::= basic_character_expression
makes the request to use the msgproptype function.
is the <msgheader> or <msgproperties> XML document. A basic_character_expression. If msg_doc is not specified, the current value of @@msgprpoperties is used.
is the property name from which you want to extract a value or type. A basic_character_expression.
A message is sent with two properties, “integer_prop,” which is an integer with value 1234, and “string_prop,” a string with the value “cat”:
select msgsend('msgproptype example', 'tibco_jms:tcp://localhost:7222?queue=queue.sample', MESSAGE PROPERTY "integer_prop=1234,string_prop='cat'") go
--------------------------------------- ID:E4JMS-SERVER.82CC311EC:1 (1 row affected)
The message is then read back:
select msgrecv('tibco_jms:tcp://localhost:7222?queue=queue.sample') go
--------------------------------------- msgproptype example (1 row affected)
The @@msgproperties global variable is selected to display what the properties were on in the message just received:
select @@msgproperties go
--------------------------------------- <?xml version="1.0" encoding="UTF-8" standalone="yes" ?> <msgproperties string_prop="'cat'" ASE_RTMS_CHARSET="1" ASE_ORIGIN="'francis_pinot_2'" ASE_SPID="15" ASE_MSGBODY_FORMAT="'string'" ASE_TIMESTAMP="'2005/06/22 15:01:36.91'" ASE_MSGBODY_SCHEMA="'NULL'" ASE_RTMS_VERSION="'1.0'" ASE_VERSION="'12.5.0.0'" integer_prop="1234"> </msgproperties> (1 row affected)
The first msgproptype call asks for the type of the “integer_prop” property, and returns “Integer”:
1> select msgproptype('integer_prop') 2> go
--------------------------------------- Integer (1 row affected)
The second msgproptype call asks for the type of the “string_prop” property, and returns “String”:
1> select msgproptype('string_prop') 2> go
--------------------------------------- String (1 row affected)
Copyright © 2005. Sybase Inc. All rights reserved. |
![]() |