table t : { Id : int, B : string }
PRIMARY KEY Id
table u : { Id : int, Link : int, C : string, D : option float }
PRIMARY KEY Id,
CONSTRAINT Link FOREIGN KEY Link REFERENCES t(Id)
fun main () =
xml <- queryX (SELECT t.Id, t.B, u.Id, u.C, u.D
FROM t LEFT JOIN u ON t.Id = u.Link)
(fn r =>
{[r.T.Id]} |
{[r.T.B]} |
{[r.U.Id]} |
{[r.U.C]} |
{[r.U.D]} |
);
return
and addT r =
dml (INSERT INTO t (Id, B) VALUES ({[readError r.Id]}, {[r.B]}));
main ()
and addU r =
dml (INSERT INTO u (Id, Link, C, D) VALUES ({[readError r.Id]}, {[readError r.Link]}, {[r.C]}, {[readError r.D]}));
main ()