The Insert operation is a custom utility method that inserts a set of key value pairs, by parsing the insert statement and uses the batchPutAttributes method to insert the key value pairs. Unlike standard SQL, the item name used is also given. If there is already an item name, the key - value pair is added to the item name.
The quoting rules are the same as for the select statement. If no quotes are used, then the value is either a number or an unquoted string.
If the value is a number then Negative Numbers Offsets, Zero Padding algorithms are used. This is a java centric implementation and works for integers (eg. 123), longs (123l), floats (1.23) and doubles (1.23d). Please see Amazon's manual for a more details, or refer to the source of SimpleDBConverter.
insert into test (`keyone`, keytwo, keythree, keyfour)
values (1.3, 2, 9l, 12.231d) If no itemName is given then a universally unique identifiers (UUID) is generated for the item name, a guarantee for no collisions of the items inserted:
insert into test (`keyone`, keytwo) values ('generate
uuid', 'value2a')The itemName can also be the first column name, this simplifies things when importing the sql into for instance mysql:
insert into test (`itemName()`, keyone, keytwo)
values ('aItemName', 'value1a', 'value2a')For the rest the insert is similar to the standard SQL INSERT statement. Example strings follow (no new line characters should be used):
insert into test (keyone, `keytwo`) values ('value1a',
'value2a'), ('value1b5', 'value2b')