<div dir="ltr">Hello, Iam also stuck with this error when trying to delete a record using dml:
<pre><code>(* Delete a given work experience *)
and deleteExperience experienceId () =
dml (DELETE FROM experienceTable
WHERE experienceTable.Id = {[experienceId]});
xml <- refresh ();
return <xml><body>
{xml}
</body></xml>
</code></pre>
<p>But when compiling I get:</p>
<pre><code>/home/drifter/dev/urweb/portfolipro/portfolipro.ur:39:15: (to 39:52) Error in final record unification
Can't unify record constructors
Have:
<UNIF:U1610::{{Type}}> ++
[ExperienceTable = ([Id = int]) ++ <UNIF:U1611::{Type}>]
Need: [T = [Id = int, Description = string]]
/home/drifter/dev/urweb/portfolipro/portfolipro.ur:39:15: (to 39:52) Stuck unifying these records after canceling matching pieces:
Have:
([ExperienceTable = ([Id = int]) ++ <UNIF:U1611::{Type}>]) ++
<UNIF:U1610::{{Type}}>
Need: [T = [Id = int, Description = string]]
</code></pre>
<p>I used as a basis existing code from a Ur/Web demo below and modified simply changing table names for my own.</p>
<pre><code> and delete a () =
dml (DELETE FROM t
WHERE t.A = {[a]});<br><br></code></pre><pre><code>My complete code is below:<br><br>table experienceTable : { Id : int, Description : string}<br> PRIMARY KEY Id<br><br>fun refresh () =<br> rows <- queryX (SELECT * FROM experienceTable)<br> (fn row => <xml><tr><br> <td>{[<a href="http://row.ExperienceTable.Id">row.ExperienceTable.Id</a>]}</td> <td>{[row.ExperienceTable.Description]}</td><br> <td><form><submit action={deleteExperience <a href="http://row.ExperienceTable.Id">row.ExperienceTable.Id</a>} value="Delete"/></form></td><br> </tr></xml>);<br> return <xml><br> <table border=1><br> <tr> <th>Id</th> <th>Description</th></tr><br> {rows}<br> </table><br><br> <br/><hr/><br/><br><br> <form><br> <table><br> <tr> <th>Id:</th> <td><textbox{#Id}/></td> </tr><br> <tr> <th>Description:</th><td><textbox{#Description}/></td> </tr><br> <tr> <th/> <td><submit action={addExperience} value="Add"/></td> </tr><br> </table><br> </form><br> </xml><br><br>(* Add a new work experience *)<br>and addExperience experience =<br> dml (INSERT INTO experienceTable (Id, Description)<br> VALUES ({[readError experience.Id]}, {[readError experience.Description]}));<br> xml <- refresh ();<br> return <xml><body><br> {xml}<br> </body></xml><br><br>(* Delete a given experience *)<br>and deleteExperience experienceId () =<br> dml (DELETE FROM experienceTable<br> WHERE experienceTable.Id = {[experienceId]});<br> xml <- refresh ();<br> return <xml><body><br> {xml}<br> </body></xml><br><br>fun main () =<br> xml <- refresh ();<br> return <xml><body><br> {xml}<br> </body></xml> <br><br></code></pre><pre><code>Any pointers would be appreciated!<br><br></code></pre><pre><code>yc<br></code></pre></div>