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