RamanGrover29@gmail.com | 58cf330 | 2012-11-09 00:27:45 +0000 | [diff] [blame] | 1 | /* |
| 2 | * Description : Create UDF and invoke in the WHERE clause of FLWOR expression |
| 3 | * Expected Res : Success |
| 4 | * Date : Sep 5th 2012 |
| 5 | */ |
| 6 | |
| 7 | drop dataverse test if exists; |
| 8 | create dataverse test; |
| 9 | |
RamanGrover29@gmail.com | 2471039 | 2012-11-11 18:57:42 +0000 | [diff] [blame] | 10 | write output to nc1:"rttest/user-defined-functions_udf19.adm"; |
RamanGrover29@gmail.com | 58cf330 | 2012-11-09 00:27:45 +0000 | [diff] [blame] | 11 | |
| 12 | create function test.pie(){ |
| 13 | 3.14 |
| 14 | } |
| 15 | |
| 16 | create function test.area($radius){ |
| 17 | test.pie() * $radius * $radius |
| 18 | } |
| 19 | |
| 20 | for $a in [2,4,6,8,10,12] |
| 21 | where test.area($a) > 100 |
| 22 | return test.area($a) |
| 23 | |