Home | Previous Page | Next Page   MQ DataBlade Module > MQ DataBlade Tables > Working with Tables > 3 3 3

Creating and Binding a Table

3

Use the MQCreateVtiReceive() function 3to create a table and bind it to a queue. The following example 3creates a table named vtimq, and binds it 3to the queue defined by service IDS.DEFAULT.SERVICE and 3policy IDS.DEFAULT.POLICY.

3

3
BEGIN WORK;
3
3EXECUTE FUNCTION MQICreateVtiReceive ("VtiMQ", 
3                "IDS.DEFAULT.SERVICE",  "IDS.DEFAULT.POLICY");
3

Using a SELECT statement on a table created with MQCreateVtiReceive(), 3results in a message is received from the table, which is the equivalent 3of calling the MQReceive() function on the 3queue. For both functions, the messages selected are removed from 3the quueue.

3

To browse the messages on the queue without removing the messages 3from the queue, use the MQCreateVtiRead() function. 3 to bind the table vtimq to a queue. In the 3following example, MQCreateVtiRead() binds 3the table vtimq to a queue: 3

3
BEGIN WORK;
3
3EXECUTE FUNCTION MQCreateVtiRead (vtimq, read-service, policy, maxMessage)
3

For complete information on the MQCreateVtiRead() or MQCreateVtiReceive() functions, 3see MQ DataBlade Functions.

Home | [ Top of Page | Previous Page | Next Page | Contents | Index ]