Hello,

I am trying to call a user-defined function from within a trigger. The trigger 
is created through the command-line interface correctly, but when I run an 
insert query that triggers the trigger, sedna dies and I have to restart sedna 
with se_gov. Here's my code for the trigger:

import module namespace func = "sedna-project";
CREATE TRIGGER "Trig_CrispRule3"
AFTER INSERT
ON document("test_bookstore")//Sales_Record
FOR EACH NODE
DO
{
        UPDATE insert
        for $b in $WHERE//Book[book_ID/text()="2"]
        where ($b//popularity < 1000) (: this runs correctly :)
(:      where ($b//popularity < $func:max)      # This is a compile error even 
though the variable $func:max is defined in the imported module:)
(:      where ($b//popularity < func:max_calc(900, 1000, 0.0))  # This causes 
sedna to die :)
        return
        <Discount_Information>
                <book_ID>4</book_ID>
                <discount_percent>26</discount_percent>
                <start_date>09/15/2008</start_date>
                <end_date>10/04/2008</end_date>
        </Discount_Information>
        following $WHERE//Discount_Information[book_ID/text()="3"];

        fn:doc("test_bookstore")//Discount_Information[book_ID/text()="3"];
}

Is there a different syntax for calling a user-defined function from inside a 
trigger?

Thanks,
Shalini

__________________________________________________
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around 
http://mail.yahoo.com 

-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
_______________________________________________
Sedna-discussion mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/sedna-discussion

Reply via email to