× The internal search function is temporarily non-functional. The current search engine is no longer viable and we are researching alternatives.
As a stop gap measure, we are using Google's custom search engine service.
If you know of an easy to use, open source, search engine ... please contact support@midrange.com.



As I am tweaking my .NET application, I found another place where maybe I
could switch to a stored a procedure. What it needs to do is first run

SELECT MAX(COMMENT_KEY) FROM MPRLRCHISP WHERE REQUEST_ID = @id

to get the next key for the comment. If there isn't one, I want to return 0.

Then I run an insert using that key as a sequence number (+1).

The question being in a stored procedure, how do set that to 0 if no result
is returned on the query?

--
Mike Wills
http://mikewills.me

As an Amazon Associate we earn from qualifying purchases.

This thread ...


Follow On AppleNews
Return to Archive home page | Return to MIDRANGE.COM home page

This mailing list archive is Copyright 1997-2024 by midrange.com and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available on our policy page. If you have questions about this, please contact [javascript protected email address].

Operating expenses for this site are earned using the Amazon Associate program and Google Adsense.