Nevermind, it was the stray semi-colon. Why did it spit out field specification errors for that though?

On 10/20/2012 06:38 AM, David Snider wrote:
I can't figure out what I'm doing wrong here. The number of fields in the insert statement is exactly the same number in the user table.

table user : {
Id : int,
Email : string,
Password : string,
FirstName : string,
LastName : string
}
PRIMARY KEY Id

table addresstype : {
Id : int,
DisplayName : string,
Value : string
}
PRIMARY KEY Id

table address : {
Id : int,
UserId : int,
AddressTypeId : int,
Address1 : string,
Address2 : string,
City : string,
State : string,
Zip : string,
Country : string
}
PRIMARY KEY Id
CONSTRAINT FK_User FOREIGN KEY (UserId) REFERENCES user(Id) ON DELETE CASCADE, CONSTRAINT FK_AddressType FOREIGN KEY (AddressTypeId) REFERENCES addresstype(Id) ON DELETE CASCADE

sequence userSeq

fun create email password firstname lastname  =
    id <- nextval userSeq;
    dml (INSERT INTO user (Id, Email,Password, FirstName, LastName)
     VALUES ({[id]},{[email]},{[password]},{[firstname]},{[lastname]})
    );

Error Message:

david@ubuntu:~/Projects/UrShop$ urweb urdemo
/home/david/Projects/UrShop/user.ur:37:8: (to 39:2) Length mismatch in INSERT field specification (5 vs. 4) /home/david/Projects/UrShop/user.ur:37:8: (to 39:2) Length mismatch in INSERT field specification (5 vs. 4) /home/david/Projects/UrShop/user.ur:37:8: (to 39:2) Length mismatch in INSERT field specification (5 vs. 4) /home/david/Projects/UrShop/user.ur:37:8: (to 39:2) Length mismatch in INSERT field specification (5 vs. 4) /home/david/Projects/UrShop/user.ur:37:8: (to 39:2) Length mismatch in INSERT field specification (5 vs. 4) /home/david/Projects/UrShop/user.ur:37:8: (to 39:2) Length mismatch in INSERT field specification (5 vs. 4) /home/david/Projects/UrShop/user.ur:37:8: (to 39:2) Length mismatch in INSERT field specification (5 vs. 4) /home/david/Projects/UrShop/user.ur:37:8: (to 39:2) Length mismatch in INSERT field specification (5 vs. 4) /home/david/Projects/UrShop/user.ur:37:8: (to 39:2) Length mismatch in INSERT field specification (5 vs. 4) /home/david/Projects/UrShop/user.ur:37:8: (to 39:2) Length mismatch in INSERT field specification (5 vs. 4) /home/david/Projects/UrShop/user.ur:37:8: (to 39:2) Length mismatch in INSERT field specification (5 vs. 4) /home/david/Projects/UrShop/user.ur:37:8: (to 39:2) Length mismatch in INSERT field specification (5 vs. 4) /home/david/Projects/UrShop/user.ur:37:8: (to 39:2) Length mismatch in INSERT field specification (5 vs. 4) /home/david/Projects/UrShop/user.ur:37:8: (to 39:2) Length mismatch in INSERT field specification (5 vs. 4) /home/david/Projects/UrShop/user.ur:37:8: (to 39:2) Length mismatch in INSERT field specification (5 vs. 4) /home/david/Projects/UrShop/user.ur:37:8: (to 39:2) Length mismatch in INSERT field specification (5 vs. 4) /home/david/Projects/UrShop/user.ur:37:8: (to 39:2) Length mismatch in INSERT field specification (5 vs. 4) /home/david/Projects/UrShop/user.ur:37:8: (to 39:2) Length mismatch in INSERT field specification (5 vs. 4) /home/david/Projects/UrShop/user.ur:37:8: (to 39:2) Length mismatch in INSERT field specification (5 vs. 4) /home/david/Projects/UrShop/user.ur:37:8: (to 39:2) Length mismatch in INSERT field specification (5 vs. 4) /home/david/Projects/UrShop/user.ur:37:8: (to 39:2) Length mismatch in INSERT field specification (5 vs. 4) /home/david/Projects/UrShop/user.ur:37:8: (to 39:2) Length mismatch in INSERT field specification (5 vs. 4) /home/david/Projects/UrShop/user.ur:37:8: (to 39:2) Length mismatch in INSERT field specification (5 vs. 4) /home/david/Projects/UrShop/user.ur:37:8: (to 39:2) Length mismatch in INSERT field specification (5 vs. 4) /home/david/Projects/UrShop/user.ur:37:8: (to 39:2) Length mismatch in INSERT field specification (5 vs. 4) /home/david/Projects/UrShop/user.ur:37:8: (to 39:2) Length mismatch in INSERT field specification (5 vs. 4) /home/david/Projects/UrShop/user.ur:37:8: (to 39:2) Length mismatch in INSERT field specification (5 vs. 4) /home/david/Projects/UrShop/user.ur:37:8: (to 39:2) Length mismatch in INSERT field specification (5 vs. 4) /home/david/Projects/UrShop/user.ur:41:0: (to 41:0) syntax error found at EOF
Parse failure



_______________________________________________
Ur mailing list
[email protected]
http://www.impredicative.com/cgi-bin/mailman/listinfo/ur


_______________________________________________
Ur mailing list
[email protected]
http://www.impredicative.com/cgi-bin/mailman/listinfo/ur

Reply via email to