Jd/Ops change

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


byten table col s
byten table col s ; fill

s is the new number of columns
overtake uses fill


delete table where

where - rows to delete:

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


insert table pairs


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 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 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 table col [desc] [,...]

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

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

same syntax as read order by clause