>>  <<  Usr  Pri  JfC  LJ  Phr  Dic  Rel  Voc  !:  Help  User

Updating a record

To update a record, you process an SQL update statement. Here we update the salary field for ABBOTT K.

First read the record to see the current value (the salary is 50817):

   sel=. 'select * from tdata where name=''ABBOTT K'''
   ddfet sel ddsel ch
+--------------+-+----+--------+---------+-----+
|ABBOTT K      |M|D103|1.9631e7|1.98309e7|50817|
+--------------+-+----+--------+---------+-----+

Next we process an update statement:

   us=. 'update tdata set salary=45000 where name=''ABBOTT K'''
   us ddsql ch

Finally, we read the record again, to ensure the update was successful:

   sel=. 'select * from tdata where name=''ABBOTT K'''
   ddfet sel ddsel ch
+--------------+-+----+--------+---------+-----+
|ABBOTT K      |M|D101|1.9631e7|1.98309e7|45000|
+--------------+-+----+--------+---------+-----+

>>  <<  Usr  Pri  JfC  LJ  Phr  Dic  Rel  Voc  !:  Help  User