09.12.2012 Views

Advanced Queuing - Oracle

Advanced Queuing - Oracle

Advanced Queuing - Oracle

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

}<br />

Listening to One or More Single-Consumer Queues<br />

printf("Error - OCI_NO_DATA\n");<br />

break;<br />

case OCI_ERROR:<br />

OCIErrorGet ((dvoid *) errhp, (ub4) 1, (text *) NULL, &errcode,<br />

errbuf, (ub4) sizeof(errbuf), (ub4) OCI_HTYPE_ERROR);<br />

printf("Error - %s\n", errbuf);<br />

break;<br />

case OCI_INVALID_HANDLE:<br />

printf("Error - OCI_INVALID_HANDLE\n");<br />

break;<br />

case OCI_STILL_EXECUTING:<br />

printf("Error - OCI_STILL_EXECUTE\n");<br />

break;<br />

case OCI_CONTINUE:<br />

printf("Error - OCI_CONTINUE\n");<br />

break;<br />

default:<br />

break;<br />

}<br />

/* set agent into descriptor */<br />

void SetAgent(agent, appname, queue,errhp)<br />

LNOCIAQAgent *agent;<br />

text *appname;<br />

text *queue;<br />

LNOCIError *errhp;<br />

{<br />

OCIAttrSet(agent, OCI_DTYPE_AQAGENT,<br />

appname ? (dvoid *)appname : (dvoid *)"",<br />

appname ? strlen((const char *)appname) : 0,<br />

OCI_ATTR_AGENT_NAME, errhp);<br />

OCIAttrSet(agent, OCI_DTYPE_AQAGENT,<br />

queue ? (dvoid *)queue : (dvoid *)"",<br />

queue ? strlen((const char *)queue) : 0,<br />

OCI_ATTR_AGENT_ADDRESS, errhp);<br />

printf("Set agent name to %s\n", appname ? (char *)appname : "NULL");<br />

printf("Set agent address to %s\n", queue ? (char *)queue : "NULL");<br />

}<br />

/* get agent from descriptor */<br />

Operational Interface: Basic Operations 11-27

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!