<div dir="ltr"><div><div><div>Hi,<br><br>Another probably basic question where I'm not getting the type system. <br><br>I have the following table:<br><br>table posts : { Id : int, Title : string, Body, :string : Author, string, Created : time }<br>          PRIMARY KEY Id<br><br>and I'm trying to compile the following code:<br><br>...<br> and posts' () : xbody =<br>     posts' <- queryX (SELECT * FROM posts)<br>              (fn row => post' {[row.Posts.Title]} {[row.Posts.Body]} {[row.Posts.Author]} {[row.Posts.Created]});<br>     <xml><div class="postsList"><br>       {posts'}<br>     </div></xml><br><br>and post' (title:string) (body:string) (authorUserId:int) (date:string) : xbody =<br>    let <br>        val numComments = 0<br>    in<br>        <xml><div class="post"><br>        <div class="postTitle">{[title]}</div><br>        <div class="postAuthor">{[authorUserId]}</div><br>        <div class="postBody">{[body]}</div><br>    <div class="postBottom"><br>            <div class="postComments"><br>            <a link={comments ()}>{[numComments]} comments</a><br>        </div><br>            <div class="postDate">{[date]}</div><br>    </div><br>        </div></xml><br>    end<br><br></div>this is giving me the following compile errors:<br><br>/root/typedweb/blog.ur:39:20: (to 39:25) syntax error: replacing  SYMBOL with  SQL<br>/root/typedweb/blog.ur:39:28: (to 39:37) This is an expression but not a pattern.<br>/root/typedweb/blog.ur:39:46: (to 39:46) syntax error: inserting  EQ<br>/root/typedweb/blog.ur:39:48: (to 39:57) This is an expression but not a pattern.<br>/root/typedweb/blog.ur:39:28: (to 39:37) This is an expression but not a pattern.<br>/root/typedweb/blog.ur:39:65: (to 39:65) syntax error: inserting  PLUS<br>/root/typedweb/blog.ur:39:67: (to 39:76) This is an expression but not a pattern.<br>/root/typedweb/blog.ur:39:48: (to 39:57) This is an expression but not a pattern.<br>/root/typedweb/blog.ur:39:86: (to 39:86) syntax error: inserting  PLUS<br><br></div>I'm trying to use the same syntax as the urblog tutorial but it's calling a post generation function but I'm still not getting it to compile properly.  Can SQL only be used in a transaction?<br><br>--<br></div>Burton Samograd<br></div>