Alexey Gaidukov wrote :

>
>
>create function GIS.ret_test
>   returns varchar AS
>VAR
>   f varchar(10);
>begin
>       select resid into :f from gis.test2;
>       return f;
>end;
>//
>select resid,GIS.ret_test() from temp.test
>
>Returns two records. Where is in this case the exception with $rc=100? 
>Very strange behavior.
>

Why do you think this behavior is strange ? Please note that there's no
exception for error 100, there's just the variable $rc which contains
the value 100 after the select statement.
Since you didn't check this variable the function returns the initial
value of f, which is null. 
Even if you use try/catch you are responsible to check $rc in the catch
block and you must decide whether this is an error to be ignored or to
be returned to the caller.
In the latter case you have to leave the function via a STOP statement.
To avoid misunderstanding you should choose error codes that do not
conflict with existing MaxDB error codes.

Best Regards,
Thomas

--
MaxDB Discussion Mailing List
For list archives: http://lists.mysql.com/maxdb
To unsubscribe:    http://lists.mysql.com/[EMAIL PROTECTED]

Reply via email to