James Harper wrote:
I just threw together some MS SQL (because that's what I've got in front
of me) code that sort of does what you want, but not in a way that could
be used in a query (you'd have to put it in a user defined function,
which is easy enough to do), and being MSSQL it won't work as given
under any of the databases bacula uses. You can probably do the same
thing in Postgres, but I'm not at all sure it can be done in the
others...
Note that the COLLATE thing is only there so that it knows that a 'W'
and a 'w' are different. Shouldn't be an issue on non-MS databases.
Hope it helps in some way (beware of line wrapping :)
James
DECLARE @b64 char(64)
DECLARE @string varchar(6)
DECLARE @val decimal(38,0)
DECLARE @pos int
SET @b64 =
'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/'
SET @string = 'BEU0tK'
SET @val = 0
SET @pos = 1
WHILE @pos <= LEN(@string)
BEGIN
SET @val = @val * 64 + CHARINDEX(SUBSTRING(@string, @pos, 1), @b64
COLLATE Latin1_General_CS_AS) - 1
SET @pos = @pos + 1
END
PRINT @val
Thanks for the example. I'll try to work out something similar and then
try to match the results with some actual file dates.
Mark
-------------------------------------------------------
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
_______________________________________________
Bacula-users mailing list
Bacula-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/bacula-users