COUNT would give you the wrong result if a select list was active at the time 
you executed it.

-----Original Message-----
From: [email protected] 
[mailto:[email protected]] On Behalf Of Allen Egerton
Sent: Thursday, April 21, 2011 12:57 PM
To: U2 Users List
Subject: Re: [U2] Very Weird Trigger Behavior

On 4/21/2011 11:03 AM, jonathanm wrote:
>
> Hi, all. I'm new to this forum, but have been programming multivalue database
<snip>

> I really need to have it perform the intended check before deletion. Any
> ideas?

Your execute of the SELECT will potentially result in an active select
list that doesn't appear to be intentionally used.  Since you don't want
 the ids, you just want to know if there are any, I'd do something like:

CMD - 'COUNT TRADES WITH TRADE_CODE = "': CODE_DEF_ID: '"'
EXECUTE CMD CAPTURING CMD.CAP RETURNING CNT.SELECTED
IF (CNT.SELECTED GT 0) THEN
    EXECUTE_STATUS = 0
END ELSE
    EXECUTE_STATUS = ????
END

I also don't know what you're doing with EXECUTE_STATUS, but if it's not
set by the caller, it needs to be set here, otherwise its value is
undetermined, (and in most cases will be set to null).

Regards.
_______________________________________________
U2-Users mailing list
[email protected]
http://listserver.u2ug.org/mailman/listinfo/u2-users
<html>
<body>
________________________________ Dave Davis Team Lead, R&amp;D P: 614-875-4910 
x108 F: 614-875-4088 E: [email protected] 
[http://www.harriscomputer.com/images/signatures/HarrisSchools.gif] 
[http://www.harriscomputer.com/images/signatures/DivisionofHarris.gif]
 6110 Enterprise Parkway Grove City, OH 43123 www.harris-schoolsolutions.com 
This message is intended exclusively for the individual or entity to which it 
is addressed. This communication may contain information that is proprietary, 
privileged or confidential
 or otherwise legally exempt from disclosure. If you are not the named 
addressee, you are not authorized to read, print, retain, copy or disseminate 
this message or any part of it. If you have received this message in error, 
please notify the sender immediately
 by e-mail and delete all copies of the message.
</body>
</html>
_______________________________________________
U2-Users mailing list
[email protected]
http://listserver.u2ug.org/mailman/listinfo/u2-users

Reply via email to