sybase sql语句中的条件里可以使用自定义函数吗
如题,select * from aaa where func(字段) < 100,我在官方文档上查询了一下,没有这种使用方法,不知道有人用过吗,谢谢 func如果是自定义函数的话,要写成 select * from aa where user.func(col)<100如果是系统函数的话,无所谓 本帖最后由 zwjwelch 于 2011-08-04 17:16 编辑
谢谢,请问sybase的自定义函数只能是java写的,然后再用installjava注册吗?
按照网上的文档,注册步骤是
java文件
package sam;
public class HelloWorld
{
public StringHello()
{
return "HelloWorld";
}
}
1.把java文件编译成class javac HelloWorld.java
2.把class文件打成jar包jar cf0 sam.jar HelloWorld.class
3.installjava -f '/home/welch3/code/test/testc/sam.jar' -j -new -S puple -U sa -P 123456 -D
能注册上但是报这个信息
Server Message: puple - Msg 10796, Level 10, State 1:
Warning! Expecting file 'HelloWorld.class' to contain Java class 'HelloWorld'. Instead, class 'sam.HelloWorld' was found. Installing the class under the correct name 'sam.HelloWorld'.
然后调用
1> select (new sam.HelloWorld())>>Hello()
2> go
报错
Msg 10707, Level 16, State 1:
Server 'puple', Line 1:
Unhandled Java Exception:
java.lang.ClassFormatError: sam.HelloWorld
.
不知道咋回事... ase15.0.2后有了udf,可以这样使用,文档估计还没更新,你看new features就知道了。 回复 4# Eisen
谢谢,看看文档先
页:
[1]