%InsertValues meta-SQL element

Syntax

%InsertValues(recname)

Description

The %InsertValues meta-SQL construct produces a comma-separated list of the record's non-null field values. Input processing is applied to the fields in the following ways:

  • If the field is a Date, a Time, or a DateTime data type, its value is automatically wrapped in %Datein, %TimeIn, or %DateTimeIn, respectively.

  • If the field is a string, its value is automatically wrapped in quotation marks.

  • If the field has a null value, it is not included in the list.

Note:

This meta-SQL construct can only be used in PeopleCode programs, not in Application Engine SQL actions. Also, this meta-SQL construct is not implemented for COBOL.

Parameters

Parameter Description

recname

Specify the name of the record to be used for inserting. This can be a bind variable, a record object, or a record name in the form recname. You can't specify a RECORD. recname, a record name in quotation marks, or a table name.

Example

Here's an example:

SQLExec("Insert into TABLE (%List(NonNull_Fields, :1)) values (%InsertValues(:⇒
1))", &Rec);

This example code is expanded into:

"Insert into TABLE (FNUM, FCHAR, FDATE) values (27, 'Y', %datein('1989-11-27'))"