Data Types in PeopleCode

本文详细介绍了 PeopleCode 中的传统数据类型和对象数据类型,包括 Number、Date、String 等基本计算所需的数据类型,以及 Object 类型如 DataBuffer Access Types 和 Display Data Types 等。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

Similar to all other programming languages PeopleCode also has conventional data types like

 

  • Number
  • Date
  • String 
for basic computing.
It should be a common practice to declare a variable before using that.
PeopleCode supports two types of datatypes
 
  1. Conventional data types
  2. Object data types 

 

Conventional Data Types

Conventional data types supported by peopleCode are  

 

  • Any

    Remember how many times you used a variable without declarig it. Any is a data type which is assigned implicitly by PeopleCode when you use a variable without declaring it. So the data type of the variable is indetermined untill a value is assigned to it. After assigning a value it becomes of the type of value assigned to it.

    The same applies to a variable which is declared with "Any" datatype.

  • Boolean

    This variable is a single bit type that can be TRUE(1) or FALSE(0).

  • Date

    This variable is a standard date that in PeopleCode is in the format YYYY-MM-DD and in the Oracle database is in the format DD-MM-YYY.

  • DateTime

    This variable is exactly what it says—the date with the time—and is in the following format: YYYY-MM-DD-HH.MI.SS.SSSSSS.

  • Integer 

    This variable is a whole number with no decimal points.
    Tips on when to use NUMBER, INTEGER, or FLOAT variables:
    Use NUMBER when you are unsure, and it will be the primary default way to declare numbers. Use INTEGER when you are counting items; a good example is when you count rows in a rowset. Use FLOAT only when you are performance tuning and the application is already working—and you know what the result should be.

  • Float
     This variable represents a floating decimal point number. The FLOAT variable is a number using a machine floating binary point or double precision. And by default the NUMBER data type in PeopleCode is a floating decimal point representation.
  • Number
    A NUMBER variable is a decimal value or integers; it can be any number that has decimal points. NUMBER and STRING are the most used variable types in PeopleCode.
  • String
    This variable can be a combination of letters, special characters, and numbers. It is
    initialized by enclosing the declared string in quotes. You can use either single or double quotes. When you need to enclose a string within a string, one type of quote is enclosed by another type. The “best practice” is to enclose strings in double quotes and embedded strings in single quotes.
  • Time 
This variable is expressed as HHMISS. When you use a function that uses TIME, it returns a numeric value.

Object data types

OBJECT variables have their own data types:
- PeopleCode Data Buffer Access Types Field, Record, Row, and Rowset.


- PeopleCode Display Data Types AnalyticGrid, Chart, Grid, GridColumn,
and Page.


- PeopleCode Internet Script Data Types Cookie, Request, and Response.


- PeopleCode Miscellaneous Data Types AESection, AnalyticInstance, Array, Crypt, Exception, File, Interlink, BIDocs, JavaObject (can only be declared as type Local), Message, MCFIMInfo, OptEngine, PostReport, ProcessRequest, RowsetCache, SoapDoc, SQL, SyncServer, TransformData (can only be declared as type Local), XmlDoc, and XmlNode (objects can only be declared as type Local).


- Global ApiObject Data Type Objects Session, PSMessages collection, PSMessages, all tree classes (trees, tree structures, nodes, levels, and etc.), and query classes.


- Local ApiObject Data Type Objects Meta SQL, Meta HTML, System
Variables, and RowSet.

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值