comparison tests/blob.ur @ 746:2c7244c066f1

sql_ufunc and octet_length
author Adam Chlipala <adamc@hcoop.net>
date Sun, 26 Apr 2009 12:35:45 -0400
parents ee2feab275db
children 034eeb099564
comparison
equal deleted inserted replaced
745:ee2feab275db 746:2c7244c066f1
10 dml (INSERT INTO t (Id, Nam, Data, Desc, Typ) 10 dml (INSERT INTO t (Id, Nam, Data, Desc, Typ)
11 VALUES ({[id]}, {[fileName r.Data]}, {[fileData r.Data]}, {[r.Desc]}, {[fileMimeType r.Data]})); 11 VALUES ({[id]}, {[fileName r.Data]}, {[fileData r.Data]}, {[r.Desc]}, {[fileMimeType r.Data]}));
12 main () 12 main ()
13 13
14 and main () = 14 and main () =
15 ls <- queryX (SELECT t.Id, t.Desc, t.Data FROM t ORDER BY t.Desc) 15 ls <- queryX (SELECT t.Id, t.Desc, octet_length(t.Data) AS Len FROM t ORDER BY t.Desc)
16 (fn r => <xml><li><a link={view r.T.Id}>{[r.T.Desc]} ({[blobSize r.T.Data]})</a></li></xml>); 16 (fn r => <xml><li><a link={view r.T.Id}>{[r.T.Desc]} ({[r.Len]})</a></li></xml>);
17 return <xml><body> 17 return <xml><body>
18 {ls} 18 {ls}
19 19
20 <br/> 20 <br/>
21 21