简体   繁体   中英

In Tibco BusinessWorks Designer, how do one catch “record not found” when using database query?

I'm quite a newbie to Tibco BubinessWorks and sql database, but somehow I have to use Tibco to host a simple web service to query a local database.

What I want to achieve is quite simple, my process in Tibco Designer will have a activity to query the database to find customername with input customerid.

But in the case that no customer was found with specific input customerid, I would like to generate an error. And I've tried to use a "success with condition" to link my database query activity with generate error activity, but I don't know to set the xpath.

The other question is, in the case that no customername of input id is found, does the database return me an null or an empty string?

If it's a null, for the xpath, is there anything like: if(customername = null)?

Thanks!!!

In both cases (ie null or empty string) string-length(customername) = 0 as an XPath expression will work fine to catch the scenario where the customer id has not returned a result. Without knowing your database schema, it's difficult to show any more detail than that.

Note that you can always check the number of rows returned also, for a count of 0 .

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM