Function
sql
insert-records &key into attributes values av-pairs query database =>
A database table.
A list of values or a query expression.
A list of attributes.
A list of two-element lists.
A database.
insert-records inserts values for attributes (or av-pairs) into the table into. The argument values may be a list of values or a query expression. If attributes is supplied then values must be a corresponding list of values for each of the listed attribute names. *default-database*.
(insert-records :into [person]
:values '("abc" "Joe" "Bloggs" 10000 3000 nil
"plumber"))
INSERT INTO PERSON
VALUES ('abc','Joe',
'Bloggs',10000,3000,NULL,'plumber')
(insert-records :into [person]
:attributes '(person_id income surname occupation)
:values '("aaa" 10 "jim" "plumb"))
INSERT INTO PERSON
(PERSON_ID,INCOME,SURNAME,OCCUPATION)
VALUES ('aaa',10,'jim','plumb')
:av-pairs.
(insert-records :into [person] :av-pairs
'((person_id "bbb") (surname "Jones")))
delete-recordsupdate-records