On Thu, Nov 29, 2012 at 04:20:09PM +0530, swapnil joshi wrote:
Hi,
i am trying to define user define function which has argument integer bat and returning integer.
step 1:
i have added function defination in udf_80.sql as follow
create function xtest(one integer) returns integer external name udf.xtest;
step 2: i have added function defination in udf.mal
module udf; Scalar function requires single value argument. ie not command xtest(b:bat[:oid,:int]):int but command xtest(b:int):int
Niels
address UDFBATxtest comment "function xtest";
module batudf; command xtest(b:bat[:oid,:int]):int address UDFBATxtest comment "function xtest";
step 3: then i have define this function in udf.c file UDFBATxtest_(int *ret, BAT *src) {
return MAL_SUCCEED; }
str UDFBATxtest(int *ires, bat *ione) { BAT *bone = NULL; str msg = NULL; /* assert calling sanity */ assert(ione != NULL);
/* bat-id -> BAT-descriptor */ if ((bone = BATdescriptor(*ione)) == NULL) throw(MAL, "batudf.xtest", RUNTIME_OBJECT_MISSING);
/* do the work */ msg = UDFBATxtest_ ( ires, bone);
return msg; }
step 4: then i have compiled source code and installed it:
step 5: i am try to execute xtest function on mclient but i got following error sql>select xtest(id) from student; TypeException:user.s23_1[16]:'udf.xtest' undefined in: _53:any := udf.xtest(_51:int) TypeException:user.s23_1[17]:'bat.insert' undefined in: _54:any := bat.insert(_45:bat[:oid,:int], _50:oid, _53:any) program contains errors
step 6: write a mail and sent to you for getting help i hope you will give me.
-- Regards, Swapnil K. Joshi
_______________________________________________ users-list mailing list users-list@monetdb.org http://mail.monetdb.org/mailman/listinfo/users-list
-- Niels Nes, Centrum Wiskunde & Informatica (CWI) Science Park 123, 1098 XG Amsterdam, The Netherlands room L3.14, phone ++31 20 592-4098 sip:4098@sip.cwi.nl url: http://www.cwi.nl/~niels e-mail: Niels.Nes@cwi.nl _______________________________________________ users-list mailing list users-list@monetdb.org http://mail.monetdb.org/mailman/listinfo/users-list