Math Functions 数学函数
Math Functions
数学函数
Use the math functions that your database offers whenever possible.
尽可能使用数据库提供的数学函数。
Internally, PeopleCode assigns types to numeric values. Calculations for the Decimal type are processed in arrays to ensure decimal point uniformity across hardware and operating system environments. This processing is much slower than calculations for type Integer, which are processed at the hardware level.
在内部,PeopleCode将类型分配给数值。Decimal类型的计算在数组中处理,以确保小数点在硬件和操作系统环境中的一致性。这种处理比Integer类型的计算要慢得多,Integer类型的计算在硬件级别上进行。
When PeopleCode converts strings to numeric values, it does so using the internal Decimal type. For performance reasons, avoid calculations using these values.
当PeopleCode将字符串转换为数值时,它使用内部Decimal类型。出于性能原因,请避免使用这些值进行计算。
A third type of numeric value is the Float type. It is not used as frequently for the following reasons:
第三种类型的数值是Float类型。由于以下原因,它没有被频繁使用:
- Constants are never stored as Float types in the compiled code.
- 常量在编译的代码中永远不会存储为Float类型。
For example, 2.5 is always Decimal type.
例如,2.5始终是Decimal类型。
- The only way to produce a Float value is by using built-in functions, such as Float or the Financial math functions.
- 生成Float值的唯一方法是使用内置函数,如Float或金融数学函数。
Use the Float type to produce a float result only if all operands are also of the Float type. Float operations occur at the hardware level.
仅当所有操作数也是Float类型时,才使用Float类型生成float结果。浮动操作发生在硬件级别。
PeopleCode does not offer optimum performance when processing non-Integer, non-Float math calculations. To perform calculations with these numeric types, consider allowing the database to perform the calculations in COBOL.
在处理非整数、非浮点数学计算时,PeopleCode不能提供最佳性能。若要使用这些数值类型执行计算,请考虑允许数据库在COBOL中执行计算。
PeopleCode supports a range of mathematical functions and numeric types. In general, if a complex calculation is run repetitively in an Application Engine program, you should carefully analyze whether to perform the calculation in a PeopleCode action or use the relational database management system (RDBMS) functions through a SQL action. Using SQL may require PeopleSoft meta-SQL to handle platform differences, but it may be the most efficient way to update field values. If SQL is not appropriate, consider numeric typing in PeopleCode, as it affects the speed and accuracy of the calculation.
PeopleCode支持一系列数学函数和数值类型。一般来说,如果一个复杂的计算是在一个Application Engine程序中重复运行,你应该仔细分析-是在PeopleCode操作中执行计算,还是通过SQL操作使用关系数据库管理系统(RDBMS)函数。使用SQL可能需要PeopleSoft meta-SQL来处理平台差异,但这可能是更新字段值最有效的方法。如果SQL不合适,可以考虑在PeopleCode中输入数值,因为这样会影响计算的速度和准确性。
SQL Class
SQL类
Instead of using the SQL class within PeopleCode, have Application Engine issue the SQL and use a Do Select action that loops around sections containing PeopleCode actions.
不要在PeopleCode中使用SQL类,而是让应用程序引擎发出SQL并使用Do Select操作,该操作在包含PeopleCode操作的部分之间循环。
Coding all of the logic within a single PeopleCode program might appear to be easier, but splitting the logic into smaller pieces is preferable because you will have better performance and will get more detailed commit control. Within a PeopleCode program, you can commit in certain cases using the CommitWork function. You can always issue a commit between Application Engine steps.
在一个PeopleCode程序中编码所有的逻辑可能看起来更容易,但是将逻辑分割成更小的部分更好,因为这样你会有更好的性能,并且会得到更详细的提交控制。在PeopleCode程序中,在某些情况下可以使用CommitWork函数提交。您可以在应用程序引擎步骤之间发出提交。
See PeopleCode Language Reference.
请参阅PeopleCode语言参考。
See “Understanding SQL Objects and Application Engine Programs” (PeopleCode API Reference).
请参阅"理解SQL对象和应用程序引擎程序"(PeopleCode API参考)。
Arrays
数组
Instead of using arrays in Application Engine PeopleCode, explore the use of temporary tables for storing pertinent or affected data. Arrays offer the following advantages:
不要在Application Engine PeopleCode中使用数组,而是使用临时表来存储相关或受影响的数据。数组具有以下优点:
- Data is available for restarts.
- 数据可用于重新启动。
- An RDBMS is efficient at managing and searching tables.
- RDBMS在管理和搜索表方面效率很高。
- Temporary tables lend themselves to set-based processing.
- 临时表适合于基于集合的处理。
You can use the Statement Timings and PeopleCode Detail Timings trace options to generate an Application Engine timings report to determine whether your program is spending significant time processing arrays.
可以使用“语句计时”和“PeopleCode Detail Timings”跟踪选项来生成应用程序引擎计时报告,以确定程序是否在处理数组上花费了大量时间。
Including Dynamic SQL
包括动态SQL
Typically, developers include dynamic constructs in Application Engine programs to change SQL based on various runtime factors or on user-defined entries on a page. You can include dynamic SQL in Application Engine programs in a variety of ways. For example, you can:
通常,开发人员在应用程序引擎程序中包含动态构造,以根据各种运行时因素或页上的用户定义项更改SQL。您可以通过多种方式在应用程序引擎程序中包含动态SQL。例如,您可以:
- Include dynamic sections using the AESection object.
- 使用AESection对象包含动态部分。
- Change SQL using the SQL class.
- 使用SQL类更改SQL。
- Reference SQL in your own tables.
- 在自己的表中引用SQL。
The AESection class is designed primarily for online section building; therefore, it will not be the most frequently used solution.
AESection类主要是为在线部分构建而设计的;因此,它不是最常用的解决方案。
Use the SQL class to store SQL in a SQL definition that you can also access in Application Designer. Then, if you have a few SQL statements to run, generate the SQL IDs based on some methodology, such as a timestamp, and then store these in a table.
使用SQL类将SQL存储在也可以在应用程序设计器中访问的SQL定义中。然后,如果有几条SQL语句要运行,则基于某种方法(比如时间戳)生成SQL ID,然后将它们存储在一个表中。
When the program runs, your SQL could query this table based on process and extract the appropriate SQL IDs to be run with a SQL action in a Do Select loop.
当程序运行时,您的SQL可以根据进程查询这个表,并提取适当的SQL ID,以便在Do Select循环中与SQL操作一起运行。
%SQL(%BIND(MY_SQLID, NOQUOTES))
For a dynamic Do action, the AE_APPLID and the AE_SECTION fields must appear in the default state record.
对于动态Do操作,AE_APPLID和AE_SECTION字段必须出现在默认状态记录中。
相关文章:
Math Functions 数学函数
Math Functions 数学函数 Use the math functions that your database offers whenever possible. 尽可能使用数据库提供的数学函数。 Internally, PeopleCode assigns types to numeric values. Calculations for the Decimal type are processed in arrays to ensure dec…...

Javaweb之Axios的详细解析
1.3.3 请求方法的别名 Axios还针对不同的请求,提供了别名方式的api,具体如下: 方法描述axios.get(url [, config])发送get请求axios.delete(url [, config])发送delete请求axios.post(url [, data[, config]])发送post请求axios.put(url [, data[, con…...

Jenkins Pipeline应用实践
Jenkins Pipeline是一种可编程的、可扩展的持续交付管道,允许您使用脚本来定义整个软件交付过程。 以下是使用Jenkins Pipeline创建和配置流水线的基本步骤。 Part 01. 创建一个Pipeline Job 在Jenkins中创建一个新的"Pipeline"类型的Job。 以下是在Je…...

给经销商开发信怎么写?做商务邮件的技巧?
如何写给经销商的开发信?代理商的外贸开发信模板? 一封令人信服的经销商开发信能够在商业世界中起到至关重要的作用。蜂邮EDM将为您介绍如何撰写一封引人注目且有说服力的经销商开发信,确保您的合作伙伴对您的业务充满信心。 经销商开发信&…...

测试架构师必备技能-Nginx安装部署实战
Nginx(“engine x”)是一款是由俄罗斯的程序设计师Igor Sysoev所开发高性能的免费开源Web和 反向代理服务器,也是一个 IMAP/POP3/SMTP 代理服务器。在高并发访问的情况下,Nginx是Apache服务器不错的替代品。官网数据显示每秒TPS高达50W左右。本文为读者朋…...

linux 账号管理实例一,stdin,passwd复习
需求 账号名称全名次要用户组是否可登录主机密码 myuser1 1st usermygroup1yespasswordmyuser22st usermygroup1yespasswordmyuser33st user无nopassword 第一:用户,和用户组创建,并分配有效用户组(初始用户组是passwd里…...

Spring-jdbcTemplate-配置数据库连接池,配置文件方式beans.xml
1、jdbc.properties jdbc.drivercom.mysql.cj.jdbc.Driver jdbc.urljdbc:mysql:///studb jdbc.userroot jdbc.pwd123456 2、beans.xml <?xml version"1.0" encoding"UTF-8"?> <beans xmlns"http://www.springframework.org/schema/beans&…...
ElasticSearch之cat component templates API
命令样例如下: curl -X GET "https://localhost:9200/_cat/component_templates?vtrue&pretty" --cacert $ES_HOME/config/certs/http_ca.crt -u "elastic:ohCxPHQBEs5*lo7F9"执行结果输出如下: name …...

FLASK博客系列7——我要插入数据库
我们来继续上次的内容,实现将数据插入数据库。 我们先更改下models.py,由于上次笔误,把外键关联写错了。在这里给大家说声抱歉。不过竟然没有小伙伴发现。 models.py from app import dbclass User(db.Model): # 表名将会是 user࿰…...
HarmonyOS应用开发者高级认证(题库)
判断题 每一个自定义组件都有自己的生命周期 正确Worker线程不支持UI操作 正确首选项preferences是以key-value形式存储数据,其中key是可以重复的。 错误HarmonyOS应用可以兼容OpenHarmony生态 正确使用端云一体化开发,无需自己搭建服务器 正确只要…...

软件建模与文档:架构师怎样绘制系统架构蓝图?
Java全能学习面试指南:https://javaxiaobear 首先,请你设想这样一个场景:如果公司安排你做架构师,要你在项目开发前期进行软件架构设计,你该如何开展你的工作?如何输出你的工作成果?如何确定你的…...

ChatGLM2-6B微调过程说明文档
参考文档: ChatGLM2-6B 微调(初体验) - 知乎 环境配置 下载anaconda,版本是Anaconda3-2023.03-0-Linux-x86_64.sh,其对应的python版本是3.10,试过3.7和3.11版本的在运行时都报错。 执行下面的命令安装anaconda sh Anaconda3-202…...
Django之中间件
引入 1、Django自带7个中间件,每个中间件都有各自的功能 2、django能够自定义中间件 3、使用场景: 1. 全局身份校验 2. 全局用户权限校验 3. 全局访问频率的校验 ...... 【1】什么是中间件 Django中间件是一个轻量级、可重用的组件,用于处理…...

sql中的left join, right join 和inner join,union 与union all的用法
left join, right join 和inner join:这些都是SQL中用来连接两个或多个表的操作。 union,union all:用于合并两个或多个 SELECT 语句的结果。 但是有时候,对于Select出来的结果集不是很清楚。 假设我们有两张表。pers…...
Linux:strace 简介
文章目录 1. 前言2. 什么是 strace ?3. 使用 strace3.1 追踪指定进程3.1.1 通过程序名追踪进程3.1.2 通过 进程 ID (PID) 追踪程序3.1.3 追踪 子进程 或 线程 3.2 系统调用情况统计3.3 追踪过滤3.3.1 追踪指定的系统调用集合3.3.2 追踪对指定文件句柄集合操作的系统调用3.3.3 …...
【深度学习】神经网络训练过程中不收敛或者训练失败的原因
在面对模型不收敛的时候,首先要保证训练的次数够多。在训练过程中,loss并不是一直在下降,准确率一直在提升的,会有一些震荡存在。只要总体趋势是在收敛就行。若训练次数够多(一般上千次,上万次,…...
el-table修改表格每行的高度包含表头
需求: 需要修改el-table表格每行的高度为54px,并且包含表头。 .el-table {tr {height: 54px;td {padding: 0;}th {padding: 0;}} }如果样式没有生效,可能.el-table需要加上样式穿透...

常用数据存储格式介绍:Excel、CSV、JSON、XML
在现代数字时代,数据经过提炼后可以推动创新、简化运营并支持决策流程。然而,在提取数据之后,并将其加载到数据库或数据仓库之前,需要将数据转化为可用的数据存储格式。本文将介绍开发者常用的4种数据存储格式,包括 Ex…...

kafka 集群 KRaft 模式搭建
Apache Kafka是一个开源分布式事件流平台,被数千家公司用于高性能数据管道、流分析、数据集成和关键任务应用程序 Kafka 官网:https://kafka.apache.org/ Kafka 在2.8版本之后,移除了对Zookeeper的依赖,将依赖于ZooKeeper的控制器…...

如何进行有效的移动应用测试?
1、识别关键功能: 对于移动应用测试,首先要了解应用的需求和功能规格,确定哪些功能是最关键的。 关键功能通常是用户最常用的功能,对应用的成功和用户体验至关重要。 2、设定测试目标和用例: 针对每个关键功能,设置具体的测试目…...
浅谈 React Hooks
React Hooks 是 React 16.8 引入的一组 API,用于在函数组件中使用 state 和其他 React 特性(例如生命周期方法、context 等)。Hooks 通过简洁的函数接口,解决了状态与 UI 的高度解耦,通过函数式编程范式实现更灵活 Rea…...

stm32G473的flash模式是单bank还是双bank?
今天突然有人stm32G473的flash模式是单bank还是双bank?由于时间太久,我真忘记了。搜搜发现,还真有人和我一样。见下面的链接:https://shequ.stmicroelectronics.cn/forum.php?modviewthread&tid644563 根据STM32G4系列参考手…...

深入理解JavaScript设计模式之单例模式
目录 什么是单例模式为什么需要单例模式常见应用场景包括 单例模式实现透明单例模式实现不透明单例模式用代理实现单例模式javaScript中的单例模式使用命名空间使用闭包封装私有变量 惰性单例通用的惰性单例 结语 什么是单例模式 单例模式(Singleton Pattern&#…...
Java - Mysql数据类型对应
Mysql数据类型java数据类型备注整型INT/INTEGERint / java.lang.Integer–BIGINTlong/java.lang.Long–––浮点型FLOATfloat/java.lang.FloatDOUBLEdouble/java.lang.Double–DECIMAL/NUMERICjava.math.BigDecimal字符串型CHARjava.lang.String固定长度字符串VARCHARjava.lang…...

对WWDC 2025 Keynote 内容的预测
借助我们以往对苹果公司发展路径的深入研究经验,以及大语言模型的分析能力,我们系统梳理了多年来苹果 WWDC 主题演讲的规律。在 WWDC 2025 即将揭幕之际,我们让 ChatGPT 对今年的 Keynote 内容进行了一个初步预测,聊作存档。等到明…...
Nginx server_name 配置说明
Nginx 是一个高性能的反向代理和负载均衡服务器,其核心配置之一是 server 块中的 server_name 指令。server_name 决定了 Nginx 如何根据客户端请求的 Host 头匹配对应的虚拟主机(Virtual Host)。 1. 简介 Nginx 使用 server_name 指令来确定…...

在WSL2的Ubuntu镜像中安装Docker
Docker官网链接: https://docs.docker.com/engine/install/ubuntu/ 1、运行以下命令卸载所有冲突的软件包: for pkg in docker.io docker-doc docker-compose docker-compose-v2 podman-docker containerd runc; do sudo apt-get remove $pkg; done2、设置Docker…...

SiFli 52把Imagie图片,Font字体资源放在指定位置,编译成指定img.bin和font.bin的问题
分区配置 (ptab.json) img 属性介绍: img 属性指定分区存放的 image 名称,指定的 image 名称必须是当前工程生成的 binary 。 如果 binary 有多个文件,则以 proj_name:binary_name 格式指定文件名, proj_name 为工程 名&…...

Yolov8 目标检测蒸馏学习记录
yolov8系列模型蒸馏基本流程,代码下载:这里本人提交了一个demo:djdll/Yolov8_Distillation: Yolov8轻量化_蒸馏代码实现 在轻量化模型设计中,**知识蒸馏(Knowledge Distillation)**被广泛应用,作为提升模型…...

如何更改默认 Crontab 编辑器 ?
在 Linux 领域中,crontab 是您可能经常遇到的一个术语。这个实用程序在类 unix 操作系统上可用,用于调度在预定义时间和间隔自动执行的任务。这对管理员和高级用户非常有益,允许他们自动执行各种系统任务。 编辑 Crontab 文件通常使用文本编…...