Jd/Ops change

From J Wiki
Jump to: navigation, search
Jd | Overview | General | Ops | Admin | Guide | Technical | Release | License | Support

delete

delete table where

where - rows to delete:

rows
rows - jd'read jdindex from table where ...'
rows - jd'key /in table';pairs - key /in gets all matches

insert

insert table pairs

update

update table where pairs

where - rows to update:

rows - _ indicates all rows
rows - jd'read jdindex from table where ...'
rows - jd'key table';key-pairs

Warning: jd'read jdindex ...' returns rows in sort order and this may well not be the order of pairs. In general this form of update should be used only where 1 row is updated or where several rows are all updated with the same values.

upsert

upsert table key pairs

key is 1 or more cols from pairs used as key

rows in pairs where key matches are updated and the rest are inserted

sort

sort table col [desc] [,...]

sort table cola
sort table cola , colb
sort table cola desc , colb

one or more cols (optional desc) used to sort table in place

same syntax as read order by clause