eremmel wrote:
Depending how far you like to go (large numbers etc). You might define a lookup table with (int,string) from 1 to 255 or even larger and use that. Larger numbers can be broken into groups of 256.
I guess I could do that. Seems awfully inefficient - I don't want to reinvent something that's in a standard library somewhere.
The latest thinking is to use an alias:
Code:
Select all
CREATE ALIAS HEX FOR "java.lang.Integer.toHexString"
But, when I use the function, I get the following error:
SQL Status: S1000
Error code: -33
Access is denied: java.lang.Integer.toHexString in statemen [snip]
If, you upgrade your HSQL database engine to HSQL 2.2.8 ( see link below ) . . . you can easily create your own function within HSQL . . . and . . . use the exact same syntax you have described above
HEX(90)
and it would return
5a
.
To create the function, with HSQL 2.2.8 . . . from the Base Menu:
T
ools ->
S
QL...
Code:
Select all
CREATE FUNCTION HEX(INPUTVALUE INTEGER) RETURNS VARCHAR(500) LANGUAGE JAVA DETERMINISTIC NO SQL EXTERNAL NAME 'CLASSPATH:java.lang.Integer.toHexString';
See the Tutorial by user
DACM
to upgrade to HSQL 2.2.8 so the above function can be created.
http://forum.openoffice.org/en/forum/vi ... 83&t=17567
I hope this helps, please be sure to let me / us know.
Sliderule
Thanks to add
[Solved]
in your
1st
post Subject (edit button top right) if this issue has been resolved.
Sliderule wrote:
If, you upgrade your HSQL database engine to HSQL 2.2.8 ( see link below ) . . . you can easily create your own function within HSQL . . . and . . . use the exact same syntax you have described above
I couldn't figure out the error I was getting and just
Connected MySQL and Base.
I'm comfortable with that. In my application it allows for a richer interaction with the data.
If that doesn't work out, I'll use your suggestion.