ddtek:sql-insert


This built-in function inserts a single record in a database table.

The syntax is:

declare updating function ddtek:sql-insert( 
    table as xs:string, 
    column as xs:string, 
    value as item()*, 
    ...) external; 

where:

table is the database table in which to insert the record. The semantics of table are equivalent to those for fn:collection(); see "Specifying Relational Database Tables".

column is the column of the database table in which to insert a value.

value is the value to insert into the specified column.

column and value are a pair in a variable argument list. If column is specified without value, an error is raised. You can specify multiple values for this pair, as shown in the example.

The following example inserts a new record with three columns into the holdings table. The columns and their values are
userid=Minollo, stockticker=TIVO, and shares=200.

ddtek:sql-insert("holdings", "userid", "Minollo", "stockticker", "TIVO", 
  "shares", 200) 

Other examples can be found in the RDBMSUpdate example.