This directory contains:

1.- A sql script to create a new login and a new user in the database to be 
    used to run examples, it also creates two user tables used in transactional
    messaging example.
	SetupDb.sql

2.- Stored procedure examples to be install in a user database:

	ConsumeFromSubscription.sql
	GetAllMsgProperties.sql
	GetMsgPropertyCount.sql
	GetMsgPropertyList.sql
	GetMsgPropertyName.sql
	GetMsgPropertyType.sql
	GetMsgPropertyValue.sql
	PublishToSubscription.sql
	QueueConsumer.sql
	QueueReceiver.sql
	QueueSender.sql
	SubscriptionConsumer.sql

3.- Scripts to run samples

  For Unix environment:

	consume_from_queue
	consume_with_selector
	consume_with_selector_print_value
	full_subscription_sample
	queue_listener
	send_to_queue
	send_with_property
	setup_samples
	send_in_transaction_full
	send_in_transaction_simple
	send_in_transaction_none
	print_global_variables

  For DOS environment:

	consume_from_queue.bat
	consume_with_selector.bat
	consume_with_selector_print_value.bat
	full_subscription_sample.bat
	queue_listener.bat
	send_to_queue.bat
	send_with_property.bat
	setup_samples.bat
	send_in_transaction_full.bat
	send_in_transaction_simple.bat
	send_in_transaction_none.bat
	print_global_variables.bat

A.- Installation 
    ------------

In order to install stored procedures to run samples you can use shell script
setup_samples.

For example:

	setup_samples ASE_SERVER1 db_name1 ASE_SERVER2 db_name2


Note that you can run samples with a single server as well, specifying the
same ASE servername and database name.

B.- Stored procedure syntax and help
    --------------------------------

All stored procedures provide a simple online help providing information about
the parameter list and meaning of each parameter.

For example:

isql -Uuser -Ppwd -SASE_SERVER1

1> PublishToSubscription help
2> go
 
PublishToSubscription
 
        Publish a single message to an existant subscription
 
                <subscription>  is the subscription name the client
                                consumes from
 
                <message_body>  message to be published
 
                [message_options] 
                                Options of the message
 
                [message_properties]
                                Properties of the message
 


C.- Stored procedure information
    ----------------------------
	QueueSender 
		Sends a single message to a destination that could be queue.

	QueueReceiver
		Consumes a message from a queue. If a selector is specified
		then it will consume only messages matching the value of 
		the selector or filter.

	QueueConsumer
		Listen from messages from a queue.

	GetMsgPropertyValue
		Get the value of a specific message property name.

	GetMsgPropertyCount
		Get the total number of properties of the message.

	GetMsgPropertyList
		Get the list of properties from the message.

	GetMsgPropertyName
		Get the name of the I-th property.

	GetMsgPropertyType
		Get the property type of a specific message property name.

	GetAllMsgProperties
		Display all property name, value and type of a message

	ConsumeFromSubscription
		Consumes a single message from an existant subscription.

	PublishToSubscription
		Publish a single message to an existant subscription.

	SubscriptionConsumer
		Listen for messages from an existant subscription.

D.- Sample scripts
    --------------

	send_to_queue 
		Calls QueueSender to send a message to a queue

	consume_from_queue
		Calls QueueTopicReceiver to receive a message fro a queue

	send_with_property
		Calls QueueSender to send a message to a queue specifying
		a message property, that can be used later in the selector.

	consume_with_selector
		Calls QueueReceiver to receive a message from a queue
		using a selector.

	consume_with_selector_print_value
		Calls QueueReceiver to receive a messag from a queue
		using a selector and printing the selector value retrieve
		from the message properties.

	queue_listener
		Calls QueueConsumer to consume messages from a queue.

	full_subscription_sample
		Ilustrates the how to consume/publish messages using 
		subscriptions.

	send_in_transaction_full
		Ilustrates transactional behaviour when messaging 
		transactional mode is set to FULL

	send_in_transaction_simple
		Ilustrates transactional behaviour when messaging 
		transactional mode is set to SIMPLE

	send_in_transaction_none
		Ilustrates transactional behaviour when messaging 
		transactional mode is set to NONE

	print_global_variables
		Ilustrates the use of global variables

E.- Scripts workflow
    ----------------

	Example - 1

		send_to_queue ORDERS_ASE db_name
		consume_from_queue ORDERS_ASE db_name

	Example - 2
		send_with_property ORDERS_ASE db_name
		consume_with_selector ORDERS_ASE db_name

	Example - 3
		send_with_property ORDERS_ASE db_name
		consume_with_selector_print_value ORDERS_ASE db_name

	Example - 4
		From one session run:

			queue_listener

		from a different session send messages:

			send_to_queue ORDERS_ASE db_name

	Example - 5
		full_subscription_sample ORDERS_ASE db_name SUPPLIER_1 db_name

	Example - 6
		print_global_variables ORDERS_ASE db_name

	Example - 7
		send_in_transaction_full ORDERS_ASE db_name
		send_in_transaction_simple ORDERS_ASE db_name
		send_in_transaction_none ORDERS_ASE db_name

	Example - 8
		print_global_variables	ORDERS_ASE db_name


D.- Execution example
    -----------------

send_to_queue ASE_SERVER1 db_name
 
 
 
 
 
                ========================================== 
                Example to send a single message to a queue
                ========================================== 
 
 
                                                                                                                                                                                                                                                                 
 --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- 
 ID:E4JMS-SERVER.3FC627F88216E:1                                                                                                                                                                                                                                 

(1 row affected)
(1 row affected)
 
 
 
.... Use consume_from_queue to retrive the message....

