%KeyEqualNoEffDt meta-SQL element
Syntax
%KeyEqualNoEffDt(recname [ correlation_id])
Description
The %KeyEqualNoEffDt meta-SQL construct expands into a conditional phrase suitable for use in a Where clause.
The conditional phrase consists of a conjunction (AND) of [correlation_id.]keyfieldname = 'keyfieldvalue' phrases for all key fields of the given record, except that it omits any key field named EFFDT.
No auto-update processing is done, but other input processing is applied to the values as follows:
-
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 a value is a string, its value is automatically wrapped in quotation marks.
-
If a value is NULL, the "=value" part is replaced with "IS NULL."
Note:
This meta-SQL can only be used in PeopleCode programs, not in Application Engine SQL actions. Also, this meta-SQL 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 RECORD. recname, a record name in quotation marks, or a table name. |
|
correlation_id |
Identify the single-letter correlation ID to relate the record specified by recname and its fields. |
Example
The EMPL_CHECKLIST record has three keys: EMPLID, CHECK_SEQ, and EFFDT. Here is a code example:
&REC = CreateRecord(EMPL_CHECKLIST);
SQLExec("Delete from TABLE A where %KeyEqualNoEffdt(:1 A)", &REC)
The example expands to:
"Delete from TABLE A
where A.EMPLID = 8001
AND A.CHECK_SEQ = 00001"