Setdiagnostics is a function which works by adding an error condition
message into the SQL error stack. A trigger program comes from the SQL
side of UV and runs within a transaction boundary, when the
setdiagnostics() function is used it will cause the trigger to go into
rollback mode on return from the trigger program.

See the UniVerse BCI Guide Chap 7 for syntax...
----------------------------
subroutine TRG.CUST.DELETE(...)
open "AR.TRANS" to fvar then
        readu rec from fvar,oldnum then
                junk = setdiagnostics("Open receivables exist for
customer ":oldnum:". Clear transactions before deleting this customer.")
        end else
                  gosub DeleteCustomer:
            end
end
return

>-----Original Message-----
>The manual seems to suggest
>that I could use SetDiagnostic to fail this . but I'm not even getting
my
>program to compile and can't find further information on the syntax of
that
>command.  Anyone know how to tell the trigger to refuse the write?


 
**********************************************************************
This email message and any files transmitted with it are confidential and 
intended solely for the use of addressed recipient(s). If you have received 
this communication in error, please reply to this e-mail to notify the sender 
of its incorrect delivery and then delete it and your reply.  It is your 
responsibility to check this email and any attachments for viruses and defects 
before opening or sending them on. Spotless collects information about you to 
provide and market our services. For information about use, disclosure and 
access, see our privacy policy at http://www.spotless.com.au 
Please consider our environment before printing this email. 
********************************************************************** 
-------
u2-users mailing list
u2-users@listserver.u2ug.org
To unsubscribe please visit http://listserver.u2ug.org/

Reply via email to