Jd/Ops change

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

byten

byten table col s
byten table col s ; fill

s is the new number of columns
overtake uses fill

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

intx

intx table col new-type

converts col from its current type to new-type
current must be int/int1/int2/int4
new-type must be int/int1/int2/int4/intx
new-type intx converts col to type that takes least space without losing data

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