using meta-SQL 使用元SQL (3)
%FirstRows
Syntax
%FirstRows(n)
Description
The %FirstRows meta-SQL variable is replaced by database-specific SQL syntax to optimize retrieval of n rows. Depending on the database, this variable optimizes:
FirstRows meta-SQL变量被特定于数据库的SQL语法替换,以优化n行的检索。根据数据库的不同,此变量会优化:
- The query path.
- 查询的路径。
- The number of rows returned.
- 返回的行数。
- The number of rows returned per fetch buffer.
- 每个获取缓冲区返回的行数。
Considerations Using %FirstRows
使用% FirstRows的注意事项
Consider the following when using %FirstRows:
这意味着SQL针对平台支持的前n行进行了优化。可能会返回更多行,具体取决于平台。
- Using %FirstRows does not mean only the first n rows are returned.
- 使用%FirstRows并不意味着只返回前n行。
It means that the SQL is optimized for the first n rows where the platform supports it. More rows might be returned, depending on the platform.
这意味着SQL针对平台支持的前n行进行了优化。可能会返回更多行,具体取决于平台。
- It is the application's responsibility to stop fetching when enough rows have been returned.
- 当返回足够多的行时,应用程序有责任停止获取。
- This meta-SQL variable is not implemented for COBOL or dynamic view SQL.
- 这个元SQL变量不是为COBOL或动态视图SQL实现的。
- Do not use this meta-SQL variable if the application might require more than n rows fetched.
- 如果应用程序可能需要获取超过n个行,请不要使用这个元SQL变量。
The results of fetching more than n rows varies by platform. Some return the extra rows, but performance may be suboptimal. Others return the message "ROW NOT FOUND".
获取超过n行的结果因平台而异。有些返回额外的行,但性能可能不理想。其他人返回的消息“行未找到”。
- Place this meta-SQL variable between the Select statement that begins the SQL statement and the Select List statement.
- 将此meta-SQL变量放在SQL语句开始的Select语句和Select List语句之间。
Do not use it in subqueries, views, Insert/Select statements, and so on. Do not use a wildcard (*) with the Select List statement.
不要在子查询、视图、插入/选择语句等中使用它。不要使用通配符(*)与“选择列表”语句一起使用。
- Do not use this meta-SQL variable with Distinct statements, because the code SELECT TOP 1 DISTINCT fails on Microsoft SQL Server.
- 不要将此元SQL变量与Distinction语句一起使用,因为在微软SQL Server上,SELEC-OP 1-Distinction代码会失败。
- This meta-SQL variable is implicitly embedded in all Select statements for SQLExecs for all platforms except Oracle.
- 这个元SQL变量隐式地嵌入到除甲骨文以外的所有平台的SQLExecs的所有Select语句中。
Parameters
Parameter | Description |
n | Specify the number of rows to optimize retrieval for. 指定要优化检索的行数 |
Example
The following code checks for the existence of a row:
下面的代码检查是否存在一行:
&SQL = CreateSQL("select %firstrows(1) 'x' from PS_EXAMPLE where COL1 = :1", &temp)⇒ ;
The following populates a 10-element array:
下面的代码填充一个包含10个元素的数组:
&SQL = CreateSQL("select %firstrows(10) COL2, COL3 from PS_EXAMPLE_VW where COL1 = ⇒
:1", &temp);
%GetProgText
Syntax
%GetProgText(&Prog,&Section,&Market,&Platform,&Effdt,&Step,&Event)
Description
The %GetProgText function returns a string with the text of a PeopleCode program uniquely identified by the parameters.
GetProgText函数返回一个字符串,其中包含由参数唯一标识的PeopleCode程序的文本。
Parameters
Parameter | Description |
&Prog | A string with the name of an Application Engine program. |
&Section | A string with the name of an Application Engine program section. |
&Market | A string specifying the market for an Application Engine program section. |
&Platform | A string specifying the platform for an Application Engine program section. |
&Effdt | A string specifying the effective date for an Application Engine program section. |
&Step | A string specifying a step in an Application Engine program section. |
&Event | A string specifying the PeopleCode event. |
Returns
A string containing the text of a PeopleCode program.
包含PeopleCode程序文本的字符串。
Example
&PeopleCodeText = GetProgText("DYNROLE_PUBL", "MAIN", "GBL", "default",
"1900-01-01", "Step03", "OnExecute");
Related Links
“Understanding the SQL Editor Window” (PeopleCode Developer’s Guide)
相关链接"了解SQL编辑器窗口"(PeopleCode开发人员指南)
%Insert
Syntax
%Insert(:num)
Description
This is a shorthand for:
这是一个简写:
Insert into %Table(:num) (%List(Nonnull_Fields :num)) values (%InsertValues(:num))
%InsertSelect
Syntax
%InsertSelect([DISTINCT, ]insert_recname, select_recname [ correlation_id] [, select_recname_n [ correlation_id_n]] [, override_field = value]. . .)
Description
The %InsertSelect meta-SQL construct generates an Insert statement with a Select statement. It does not generate a From statement. You must specify the select records before you specify override fields.
InsertSelect meta-SQL构造使用Select语句生成一个Insert语句。它不生成From语句。在指定覆盖字段之前,必须指定选择记录。
Note: %InsertSelect has a limit of 99 override fields.
注意:%InsertSelect有99个覆盖字段的限制。
The Insert column list is composed of all the fields in the specified insert_recname, with the exception of LongChar or Image fields.
Note: Because of the way long values (LongChar and Image fields) are handled in the various database platforms for Insert statements, all long values in insert_recname are skipped in the generated Insert statement. This implies that these fields should be defined in such a manner as to allow null values. If you need to include long values in insert_recname use %InsertSelectWithLongs.
The corresponding value in the Select list is generated based on the following precedence:
选择列表中的相应值将根据以下优先级生成:
- If the Insert fieldname appears as an override_field, the corresponding value is used in the Select list.
如果Insert字段名显示为override_field,则在Select列表中使用相应的值。
- If the Insert field name matches a field name in one of the select_recname variables specified, the corresponding Select field is used in the Select list.
如果Insert字段名与指定的select_recname变量中的某个字段名匹配,则在Select列表中使用相应的Select字段。
- The search order of the select_recname records is the order that they are specified in the %InsertSelect function.
select_recname记录的搜索顺序是在%InsertSelect函数中指定的顺序。
- If the Insert field name has a constant default value defined in Application Designer, that value is used in the Select list.
如果“插入”字段名具有在应用程序设计器中定义的常量默认值,则在“选择”列表中使用该值。
- A default value appropriate for the data type of the Insert field is used (blank for characters, zero for numbers, NULL for Date, Time, and DateTime values, and so on.)
使用与Insert字段的数据类型相适应的默认值(空格表示字符,0表示数字,NULL表示Date、Time和DateTime值,等等)。
Use the optional override_field variable to specify values for a particular field.
使用可选的override_field变量为特定字段指定值。
Note: You cannot use bind variables with the override_field.
注意:不能将绑定变量与override_field一起使用。
For each field you specify, the matching logic described in the preceding list is not performed. Instead, the value that you specify after the equal sign is used for that field in the actual Select list. Use this technique to let PeopleTools or Application Engine handle most of the fields in the record, while specifying some of them explicitly. Also, you can use override_field to specify aggregate functions like Sum, Max, and so on.
对于您指定的每个字段,不执行前面列表中描述的匹配逻辑。相反,在等号后面指定的值将用于实际的“选择”列表中的该字段。使用此技术可以让PeopleTools或应用程序引擎处理记录中的大多数字段,同时显式指定其中的一些字段。此外,还可以使用override_field指定聚合函数,如Sum、Max等。
Note: This meta-SQL is not implemented for COBOL.
注意:这个元SQL不是为COBOL实现的。
Parameters
Parameter | Description |
DISTINCT | Specify if the Select statement being generated should contain a Distinct clause. |
insert_recname | Specify the name of record being inserted into. You must specify a record name, not RECORD. recname, a record name in quotation marks, a bind variable, or a table name. Note: If the record for insert_recname is a temporary table, %InsertSelect automatically substitutes the corresponding table instance (PS_TARGETnn instead of PS_TARGET). |
select_recname | Specify the name of record being selected from. You can specify more than one record. You must specify a record name, not a RECORD. recname, a record name in quotation marks, or a table name. |
correlation_id | Identify the correlation ID to be used for the select_recname records and fields. |
override_field | Specify the name of a field on insert_recname that you want to supply a value for (instead of using the value supplied from the select_recname.) |
Value | Specify the value that should be used for the override_field instead of the value from select_recname. |
Example
Here is a basic example:
下面是一个基本的例子:
%InsertSelect(AE_SECTION_TBL, AE_STEP_TBL S, AE_SECTION_TYPE = ' ')
FROM PS_AE_STEP_TBL S, PS_AS_STMT_TBL T WHERE. . .
The example code resolves into the following:
示例代码解析为以下内容:
INSERT INTO PS_AE_SECTION_TBL (AE_APPLID, AE_SECTION,. . ., AE_SECTION_TYPE)
SELECT S.AE_APPL_ID, S.AE_SECTION, . . . ' '
FROM PS_AE_STEP_TBL S, PS_AS_STMT_TBL T WHERE. . .
In the following example, you have a temporary table, PS_MY_TEMP, which is based on a join between two other tables, PS_MY_TABLE1 and PS_MY_TABLE2:
在以下示例中,您有一个临时表PS_MY_TEMP,它基于另外两个表PS_MY_TABLE1和PS_MY/TABLE2之间的联接:
%InsertSelect(MY_TEMP, MY_TABLE1, MY_TABLE2 T2)
FROM PS_MY_TABLE1 T1, PS_MY_TABLE2 T2 WHERE %Join(COMMON_KEYS, MY_TABLE1 T1, MY_TABLE2 T2) . . .
This code resolves into:
这段代码解析为:
INSERT INTO PS_MY_TEMP (FIELD1, FIELD2 . . .) SELECT T2.FIELD1, T2.FIELD2, . . .
FROM PS_MY_TABLE1 T1, PS_MYTABLE2 T2
WHERE T1.FIELD1 = T2.FIELD1 AND T1.FIELD2 = T2.FIELD2 . . .
The following example creates a distinct Select statement.
下面的示例创建一个独特的Select语句。
%InsertSelect(DISTINCT, MY_TABLE, TABLE1, TABLE2 T2)
FROM PS_TABLE1 T1, PS_TABLE2 T2 WHERE %Join(COMMON_KEYS, TABLE1 T1, TABLE2 T2) . . .
This code resolves into:
这段代码解析为:
INSERT INTO PS_MYTABLE (FIELD1, FIELD2 . . .) SELECT DISTINCT T2.FIELD1, T2.FIELD2, . . .
FROM PS_TABLE1 T1, PS_TABLE2 T2
WHERE T1.FIELD1 = T2.FIELD1 AND T1.FIELD2 = T2.FIELD2 . . .
Related Links %InsertSelectWithLongs
相关链接%Insert Select with Long
%InsertSelectWithLongs
Syntax
%InsertSelectWithLongs([DISTINCT, ]insert_recname, select_recname [ correlation_id]⇒
[, select_recname_n [ correlation_id_n]] [, override_field = value]. . .)
Description
The %InsertSelectWithLongs meta-SQL construct generates an Insert statement with a Select statement. It does not generate a From statement. You must specify the select records before you specify override fields.
Insert Select With Long元SQL构造使用Select语句生成一个Insert语句。它不生成From语句。在指定覆盖字段之前,必须指定选择记录。
Use %InsertSelectWithLongs instead of %InsertSelect when the fields in insert_recname include long values (LongChar and Image fields).
当insert_recname中的字段包含长值(LongChar和Image字段)时,使用%InsertSelectWithLongs代替%InsertSelect。
Note: %InsertSelectWithLongs has a limit of 99 override fields.
附注:%Insert Select With Long限制为99个覆盖字段。
The Insert column list is composed of all the fields in the specified insert_recname.
“插入”列列表由指定的insert_recname中的所有字段组成。
The corresponding value in the Select list is generated based on the following precedence:
选择列表中的相应值将根据以下优先级生成:
- If the Insert fieldname appears as an override_field, the corresponding value is used in the Select list.
如果Insert字段名显示为override_field,则在Select列表中使用相应的值。
- If the Insert field name matches a field name in one of the select_recname variables specified, the corresponding Select field is used in the Select list.
如果Insert字段名与指定的select_recname变量中的某个字段名匹配,则在Select列表中使用相应的Select字段。
- The search order of the select_recname records is the order that they are specified in the %InsertSelectWithLongs function.
select_recname记录的搜索顺序是在%InsertSelect函数中指定的顺序。
- If the Insert field name has a constant default value defined in Application Designer, that value is used in the Select list.
如果“插入”字段名具有在应用程序设计器中定义的常量默认值,则在“选择”列表中使用该值。
- A default value appropriate for the data type of the Insert field is used (blank for characters, zero for numbers, NULL for Date, Time, and DateTime values, and so on.) Use the optional override_field variable to specify values for a particular field.
使用与Insert字段的数据类型相适应的默认值(空格表示字符,0表示数字,NULL表示Date、Time和DateTime值,等等)。
Note: You cannot use bind variables with the override_field.
注意:不能将绑定变量与override_field一起使用。
For each field you specify, the matching logic described in the preceding list is not performed. Instead, the value that you specify after the equal sign is used for that field in the actual Select list. Use this technique to let PeopleTools or Application Engine handle most of the fields in the record, while specifying some of them explicitly. Also, you can use override_field to specify aggregate functions like Sum, Max, and so on.
对于您指定的每个字段,不执行前面列表中描述的匹配逻辑。相反,在等号后面指定的值将用于实际的“选择”列表中的该字段。使用此技术可以让PeopleTools或应用程序引擎处理记录中的大多数字段,同时显式指定其中的一些字段。此外,还可以使用override_field指定聚合函数,如Sum、Max等。
Note: This meta-SQL is not implemented for COBOL.
注意:这个元SQL不是为COBOL实现的。
Parameters
Parameter | Description |
DISTINCT | Specify if the Select statement being generated should contain a Distinct clause. |
insert_recname | Specify the name of record being inserted into. You must specify a record name, not RECORD. recname, a record name in quotation marks, a bind variable, or a table name. Note: If the record for insert_recname is a temporary table, %InsertSelectWithLongs automatically substitutes the corresponding table instance (PS_TARGETnn instead of PS_ TARGET). |
select_recname | Specify the name of record being selected from. You can specify more than one record. You must specify a record name, not a RECORD. recname, a record name in quotation marks, or a table name. |
correlation_id | Identify the correlation ID to be used for the select_recname records and fields. |
Parameter | Description |
override_field | Specify the name of a field on insert_recname that you want to supply a value for (instead of using the value supplied from the select_recname.) |
Value | Specify the value that should be used for the override_field instead of the value from select_recname. |
Example
Here is a basic example:
下面是一个基本的例子:
%InsertSelectWithLongs(AE_SECTION_TBL, AE_STEP_TBL S, AE_SECTION_TYPE = ' ')
FROM PS_AE_STEP_TBL S, PS_AS_STMT_TBL T WHERE. . .
The example code resolves into the following:
示例代码解析为以下内容:
INSERT INTO PS_AE_SECTION_TBL (AE_APPLID, AE_SECTION,. . ., AE_SECTION_TYPE)
SELECT S.AE_APPL_ID, S.AE_SECTION, . . . ' '
FROM PS_AE_STEP_TBL S, PS_AS_STMT_TBL T WHERE. . .
In the following example, you have a temporary table, PS_MY_TEMP, which is based on a join between two other tables, PS_MY_TABLE1 and PS_MY_TABLE2:
在以下示例中,您有一个临时表PS_MY_TEMP,它基于另外两个表PS_MY_TABLE1和PS_MY/TABLE2之间的联接:
%InsertSelectWithLongs(MY_TEMP, MY_TABLE1, MY_TABLE2 T2)
FROM PS_MY_TABLE1 T1, PS_MY_TABLE2 T2 WHERE %Join(COMMON_KEYS, MY_TABLE1 T1, MY_TABLE2 T2) . . .
This code resolves into:
这段代码解析为:
INSERT INTO PS_MY_TEMP (FIELD1, FIELD2 . . .) SELECT T2.FIELD1, T2.FIELD2, . . .
FROM PS_MY_TABLE1 T1, PS_MYTABLE2 T2
WHERE T1.FIELD1 = T2.FIELD1 AND T1.FIELD2 = T2.FIELD2 . . .
The following example creates a distinct Select statement.
下面的示例创建一个独特的Select语句。
%InsertSelectWithLongs(DISTINCT, MY_TABLE, TABLE1, TABLE2 T2)
FROM PS_TABLE1 T1, PS_TABLE2 T2 WHERE %Join(COMMON_KEYS, TABLE1 T1, TABLE2 T2) . . .
This code resolves into:
这段代码解析为:
INSERT INTO PS_MYTABLE (FIELD1, FIELD2 . . .) SELECT DISTINCT T2.FIELD1, T2.FIELD2, . . .
FROM PS_TABLE1 T1, PS_TABLE2 T2
WHERE T1.FIELD1 = T2.FIELD1 AND T1.FIELD2 = T2.FIELD2 . . .
Related Links
%InsertSelect
相关链接% InsertSelect
%InsertValues
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:
InsertValues元SQL构造生成记录的非空字段值的逗号分隔列表。输入处理以下列方式应用于字段:
- If the field is a Date, a Time, or a DateTime data type, its value is automatically wrapped in %Datein, %TimeIn, or %DateTimeIn, respectively.
- 如果字段是Date、Time或DateTime数据类型,则其值将分别自动包装在%Datein、%TimeIn或%DateTime In中。
- 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.
附注:这个元SQL构造只能在PeopleCode程序中使用,不能在Application Engine SQL操作中使用。而且,这个元SQL构造也不是为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'))"
%IsRunningOnline
Description
Use the %IsRunningOnline meta-variable to determine whether the current Application Engine program is running in online mode or batch mode.
使用%IsRunningOnline元变量确定当前应用程序引擎程序是以联机模式还是批处理模式运行。
Returns
If %IsRunningOnline = 'N', then the current Application Engine program is running in batch mode.
如果% IsRunningOnline =‘ N ’,那么当前的应用程序引擎程序正在批量模式下运行。
If %IsRunningOnline = 'Y', then the current Application Engine program is running in online mode.
如果% IsRunningOnline =“ Y ”,那么当前应用程序引擎程序正在联机模式下运行。
Examples
%Select(FS_BP_WRK_AET.SELECT_FLAG)
SELECT 'X'
FROM PS_INSTALLATION
WHERE %IsRunningOnline = 'N'
%Select(FS_BP_WRK_SET.SELECT_FLAG
SELECT 'X'
FROM PS_INSTALLATION
WHERE %IsRunningOnline = 'Y'
%Join
Syntax
%Join({COMMON_KEYS | COMMON_FIELDS}, join_recname [ correlation_id1], to_recname
[ correlation_id2] [, override_field_list])
where override_field_list is an arbitrary-length list of fields to be substituted in the resulting text string, in the form: field1 [, field2]. . .
其中override_field_list是在结果文本字符串中被替换的任意长度的字段列表,形式为: field1 [, field2]. . .
Description
Use the %Join meta-SQL construct to dynamically build a Where clause joining one table to another. At runtime, the entire construct is replaced with a character string.
使用%Join meta-SQL构造来动态构建一个将一个表连接到另一个表的Where子句。在运行时,整个构造被替换为一个字符串。
Note: This meta-SQL construct is not implemented for COBOL. If date key fields are not marked as required in the record definition for either of the referenced tables in the %Join clause, a Null clause check is added to the date field comparison. This additional clause can have a significant impact on the execution time for the generated SQL statement.
注意:这个元SQL构造不是为COBOL实现的。如果在%Join子句中的两个引用表的记录定义中未按要求标记日期关键字字段,则会在日期字段比较中添加Null子句检查。这个附加子句会对生成的SQL语句的执行时间产生重大影响。
Parameters
Parameter | Description |
{COMMON_KEYS | COMMON_FIELDS} | Use COMMON_KEYS to specify that all common primary key fields are used in constructing a Where clause; use COMMON_FIELDS to specify all common fields, not just key fields. You can select either COMMON_KEYS or COMMON_FIELDS. |
join_recname | Specify the name of the record to be joined. 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. |
correlation_id1 | Identify the correlation ID used to relate the record specified by join_recname and its fields. |
to_recname | Specify the name of the record to be joined to. 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. |
correlation_id2 | Identify the correlation ID used to relate the record specified by to_recname and its fields. |
override_field_list | Specify a list of fields that you do not want used in the join. For example, if fields A, B, and C were common to two records, and you didn't want to join on C, list C as an override _field. |
Example
Here is an example:
%Join(COMMON_KEYS, PSAESECTDEFN ABC, PSAESTEPDEFN XYZ)
The example code results in the following being generated:
ABC.AE_APPLID = XYZ.AE_APPLID
AND ABC.AE_SECTION = XYZ.AE_SECTION
AND ABC.DBTYPE = XYZ.DBTYPE
AND ABC.EFFDT = XYZ.EFFDT
Here's another example:
%Join(COMMON_FIELDS, PSAEAPPLDEFN ABC, PSAESECTDEFN XYZ)
The second example results in the following being generated:
ABC.AE_APPLID = XYZ.AE_APPLID
AND ABC.DESCR = XYZ.DESCR
However, you do not want to perform the join using the DESCR field because it's a long field. Instead use override_field, as shown in the following code:
%Join(COMMON_FIELDS, PSAEAPPLDEFN ABC, PSAESECTDEFN XYZ, DESCR)
This example results in the following being generated:
ABC.AE_APPLID = XYZ.AE_APPLID
You can also specify a value for a field. Suppose you want to join two tables, but not on the field C3. In addition, you would like to specify a value for C3. Your code could look like the following:
%Join(COMMON_FIELDS, MY_TABLE1 A, MY_TABLE2 B, C3) AND C3 = 'XX'
%JobInstance
Description
Use the %JobInstance meta-variable to specify the numeric (unquoted) PeopleSoft Process Scheduler job instance.
使用%JobInstance元变量来指定PeopleSoft Process Scheduler作业实例。
%KeyEqual
Syntax
%KeyEqual(recname [ correlation_id])
Description
The %KeyEqual meta-SQL construct expands into a conditional phrase suitable for use in a Where clause.
KeyEqual元SQL构造扩展为适合在Where子句中使用的条件短语。
The conditional phrase consists of a conjunction (AND) of [correlation_id.]keyfieldname = 'keyfieldvalue' phrases for each key field of the given record.
条件短语由【 correlation _ id .】 keyfieldname =‘ keyfieldvalue ’短语的连接词( AND )组成,用于给定记录的每个键字段。
No auto-update processing is done, but other input processing is applied to the values, according to the following:
没有进行自动更新处理,但根据以下内容,对值应用了其他输入处理:
- If the field is a Date, a Time, or a DateTime data type, its value is automatically wrapped in %Datein, %TimeIn, or %DateTimeIn, respectively.
- 如果字段是Date、Time或DateTime数据类型,则其值将分别自动包装在%Datein、%TimeIn或%DateTime In中。
- 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".
- 如果值为 NULL ,则“= value ”部分被替换为“ 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.
注意:这个元SQL只能在PeopleCode程序中使用,不能在Application Engine SQL操作中使用。而且,这个元SQL不是为COBOL实现的。
Example
Suppose that the record &REC has three keys: FNUM, FDATE, and FSMART. Here is a code example:
假设Record &REC有三个键:FNUM、FDATE和FSMART。下面是一个代码示例:
Local record &REC;
&REC = CreateRecord(RECORD.MYRECORD);
&REC.FNUM.Value = 27;
&REC.FDATE.Value = %Date;
SQLExec("Delete from MYRECORD A where %KeyEqual(:1 A)", &REC);
This example expands to:
"Delete from TABLE A where A.FNUM = 27 AND A.FDATE = %Date('1989-11-27')
AND A.FSMART IS NULL"
%KeyEqualNoEffDt
Syntax
%KeyEqualNoEffDt(recname [ correlation_id])
Description
The %KeyEqualNoEffDt meta-SQL construct expands into a conditional phrase suitable for use in a Where clause.
KeyEqualNoEffDt meta-SQL构造扩展为适合在Where子句中使用的条件短语。
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.
条件短语由【 correlation _ id .】 keyfieldname =‘ keyfieldvalue ’短语的连接( AND )组成,用于给定记录的所有关键字段,但它忽略了任何名为 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.
- 如果字段是Date、Time或DateTime数据类型,则其值将分别自动包装在%Datein、%TimeIn或%DateTime In中。
- 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."
- 如果值为 NULL ,则“= value ”部分被替换为“ 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.
注意:这个元SQL只能在PeopleCode程序中使用,不能在Application Engine SQL操作中使用。而且,这个元SQL不是为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:
Empl_核对表记录有三个键:EMPLID、CHECK_SEQ和EFFDT。下面是一个代码示例:
&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"m
相关文章:
using meta-SQL 使用元SQL (3)
%FirstRows Syntax %FirstRows(n) Description The %FirstRows meta-SQL variable is replaced by database-specific SQL syntax to optimize retrieval of n rows. Depending on the database, this variable optimizes: FirstRows meta-SQL变量被特定于数据库的SQL语法…...

Spinnaker 基于 docker registry 触发部署
docker registry 触发部署 Spinnaker可以通过Docker镜像的变化来触发部署,这种方法允许你在Docker镜像发生变化时自动启动新的部署流程。 示例原理如下图所示: 以下是如何在Spinnaker中实现基于Docker Registry触发部署的配置流程。最终实现的效果如下…...

2023亚马逊云科技re:Invent,在开发者板块探究如何利用技术重塑业务
美国当地时间11月27日,一年一度的亚马逊云科技re:Invent大会在美国拉斯维加斯盛大开幕。这场全球云计算领域的前沿盛会,已连续12年成为引领行业的风向标。那么本次2023亚马逊云科技re:Invent大会又有哪些可玩、可看的新项目,下面就一起来瞧一…...
JAVA 使用stream流将List中的对象某一属性创建新的List
JAVA 使用stream流将List中的对象某一属性创建新的List 1.stream流介绍 Java Stream是Java 8引入的一种新机制,它可以让我们以声明式方式操作集合数据,提供了更加简洁、优雅的集合处理方式。Stream是一个来自数据源的元素队列,并支持聚合操…...

Elasticsearch:ES|QL 函数及操作符
如果你对 ES|QL 还不是很熟悉的话,请阅读之前的文章 “Elasticsearch:ES|QL 查询语言简介”。ES|QL 提供了一整套用于处理数据的函数和运算符。 功能分为以下几类: 目录 ES|QL 聚合函数 AVG COUNT COUNT_DISTINCT 计数为近…...

SpringBoot——Swagger2 接口规范
优质博文:IT-BLOG-CN 如今,REST和微服务已经有了很大的发展势头。但是,REST规范中并没有提供一种规范来编写我们的对外REST接口API文档。每个人都在用自己的方式记录api文档,因此没有一种标准规范能够让我们很容易的理解和使用该…...

网络入门---网络编程预备知识
目录标题 ifconfigip地址和mac地址的区别端口号pid和端口号UDP和TCP的初步了解网络字节序socket套接字 ifconfig 通过指令ifconfig便可以查看到两个网络接口: 我们当前使用的是一个linux服务器并是一个终端设备,所以他只需要一个接口用来入网即可&…...

记录一次YAMLException异常
记录一次YAMLException异常 ✅作者简介:大家好,我是Leo,热爱Java后端开发者,一个想要与大家共同进步的男人😉😉 🍎个人主页:Leo的博客 💞当前专栏: 报错以及B…...
calendar --- 日历相关函数
calendar --- 日历相关函数 源代码: Lib/calendar.py 这个模块让你可以输出像 Unix cal 那样的日历,它还提供了其它与日历相关的实用函数。 默认情况下,这些日历把星期一作为一周的第一天,星期天作为一周的最后一天(这…...
中国信息通信研究院产业与规划研究所校招一面、二面内容
本文介绍2024届秋招中,中国信息通信研究院的数字孪生智慧城市研究员岗位一面、二面的面试基本情况、提问问题等。 10月投递了中国信息通信研究院的数字孪生智慧城市研究员岗位,所在部门为数字孪生与城市数字化研究部。目前完成了一面与二面,在…...
一些数据库学习的小结
一些数据库学习的小结: SQL: 遵循ACID原则。支持Transaction。适合在线交易处理(OLTP),不适合在线分析处理(OLAP)。例子有 MySQL 读写效率 单机约1KQPS POSTGRESQL NoSQL: 遵循BASE原则。不支持Transaction。例子有 DynamoDB - Amazon Key-Value BigTa…...

【计算机网络】虚拟路由冗余(VRRP)协议原理与配置
目录 1、VRRP虚拟路由器冗余协议 1.1、协议作用 1.2、名词解释 1.3、简介 1.4、工作原理 1.5、应用实例 2、 VRRP配置 2.1、配置命令 1、VRRP虚拟路由器冗余协议 1.1、协议作用 虚拟路由冗余协议(Virtual Router Redundancy Protocol,简称VRRP)是由IETF…...
Using Set Processing Examples 使用集合处理示例
Using Set Processing Examples 使用集合处理示例 Each of the following topics contains an example of set processing. 以下每个主题都包含一个集处理示例。 Payroll 工资单 In this example, suppose the payroll department needs to give a 1000 USD salary increase to…...

Spark将execl表格文件导入到mysql中
实现代码 excel所需的pom依赖 案例实现 实现代码 package excel_mysqlimport org.apache.spark.sql.SparkSession import java.util.Propertiesobject t1 {def main(args: Array[String]): Unit {val spark SparkSession.builder().appName("ExcelToMySQL") /…...

Vue3-Eslint配置代码风格
prettier风格配置 官网:https://prettier.io Eslint:代码纠错,关注于规范 prettier:专注于代码格式化的插件,让代码更加美观 两者各有所长,配合使用优化代码 生效前提: 1)禁用…...

“Install Js dependencies failed“JS SDK安装失败【Bug已解决-鸿蒙开发】
文章目录 项目场景:问题描述原因分析:解决方案:解决措施1解决方案2:其他解决方案解决方案3:此Bug解决方案总结项目场景: 在下载JS SDK时,出现下载失败的情况,并显示“Install Js dependencies failed”。 在使用版本为DevEco Studio 3.0.0.601 Beta1进行低代码开发时…...

接口测试入门8问(含答案+文档)
Q1:什么是接口测试,基础知识什么的讲讲吧! A:你好,接口可以分下面几种 1、系统与系统之间的调用,比如银行会提供接口供电子商务网站调用,或者说,支付宝会提供接口给淘宝调用 2、上…...
【Spring之事务底层源码解析,持续更新中~~~】
文章目录 一、EnableTransactionManagement工作原理二、Spring事务基本执行原理三、Spring事务传播机制与分类四、Spring事务强制回滚五、TransactionSynchronization六、Spring事务详细执行流程 一、EnableTransactionManagement工作原理 二、Spring事务基本执行原理 三、Sp…...

吃火锅(Python)
题目描述 吃火锅 以上图片来自微信朋友圈:这种天气你有什么破事打电话给我基本没用。但是如果你说“吃火锅”,那就厉害了,我们的故事就开始了。 本题要求你实现一个程序,自动检查你朋友给你发来的信息里有没有 chi1 huo3 guo1。…...

深圳市东星制冷机电受邀莅临2024国际生物发酵展,济南与您相约
深圳市东星制冷机电有限公司受邀莅临2024国际生物发酵展,济南3月5-7日与您相约! 展位号:1号馆A53 深圳市东星制冷机电有限公司,(东星集团)是一家专业生产制冷设备的外商独资大型集团企业,拥有30多年的生产…...
椭圆曲线密码学(ECC)
一、ECC算法概述 椭圆曲线密码学(Elliptic Curve Cryptography)是基于椭圆曲线数学理论的公钥密码系统,由Neal Koblitz和Victor Miller在1985年独立提出。相比RSA,ECC在相同安全强度下密钥更短(256位ECC ≈ 3072位RSA…...
java 实现excel文件转pdf | 无水印 | 无限制
文章目录 目录 文章目录 前言 1.项目远程仓库配置 2.pom文件引入相关依赖 3.代码破解 二、Excel转PDF 1.代码实现 2.Aspose.License.xml 授权文件 总结 前言 java处理excel转pdf一直没找到什么好用的免费jar包工具,自己手写的难度,恐怕高级程序员花费一年的事件,也…...
全面解析各类VPN技术:GRE、IPsec、L2TP、SSL与MPLS VPN对比
目录 引言 VPN技术概述 GRE VPN 3.1 GRE封装结构 3.2 GRE的应用场景 GRE over IPsec 4.1 GRE over IPsec封装结构 4.2 为什么使用GRE over IPsec? IPsec VPN 5.1 IPsec传输模式(Transport Mode) 5.2 IPsec隧道模式(Tunne…...
Python 包管理器 uv 介绍
Python 包管理器 uv 全面介绍 uv 是由 Astral(热门工具 Ruff 的开发者)推出的下一代高性能 Python 包管理器和构建工具,用 Rust 编写。它旨在解决传统工具(如 pip、virtualenv、pip-tools)的性能瓶颈,同时…...

sipsak:SIP瑞士军刀!全参数详细教程!Kali Linux教程!
简介 sipsak 是一个面向会话初始协议 (SIP) 应用程序开发人员和管理员的小型命令行工具。它可以用于对 SIP 应用程序和设备进行一些简单的测试。 sipsak 是一款 SIP 压力和诊断实用程序。它通过 sip-uri 向服务器发送 SIP 请求,并检查收到的响应。它以以下模式之一…...
关于uniapp展示PDF的解决方案
在 UniApp 的 H5 环境中使用 pdf-vue3 组件可以实现完整的 PDF 预览功能。以下是详细实现步骤和注意事项: 一、安装依赖 安装 pdf-vue3 和 PDF.js 核心库: npm install pdf-vue3 pdfjs-dist二、基本使用示例 <template><view class"con…...
Modbus RTU与Modbus TCP详解指南
目录 1. Modbus协议基础 1.1 什么是Modbus? 1.2 Modbus协议历史 1.3 Modbus协议族 1.4 Modbus通信模型 🎭 主从架构 🔄 请求响应模式 2. Modbus RTU详解 2.1 RTU是什么? 2.2 RTU物理层 🔌 连接方式 ⚡ 通信参数 2.3 RTU数据帧格式 📦 帧结构详解 🔍…...

软件工程 期末复习
瀑布模型:计划 螺旋模型:风险低 原型模型: 用户反馈 喷泉模型:代码复用 高内聚 低耦合:模块内部功能紧密 模块之间依赖程度小 高内聚:指的是一个模块内部的功能应该紧密相关。换句话说,一个模块应当只实现单一的功能…...

spring Security对RBAC及其ABAC的支持使用
RBAC (基于角色的访问控制) RBAC (Role-Based Access Control) 是 Spring Security 中最常用的权限模型,它将权限分配给角色,再将角色分配给用户。 RBAC 核心实现 1. 数据库设计 users roles permissions ------- ------…...

leetcode73-矩阵置零
leetcode 73 思路 记录 0 元素的位置:遍历整个矩阵,找出所有值为 0 的元素,并将它们的坐标记录在数组zeroPosition中置零操作:遍历记录的所有 0 元素位置,将每个位置对应的行和列的所有元素置为 0 具体步骤 初始化…...