137 Data Types in People Code

You might also like

Download as pdf or txt
Download as pdf or txt
You are on page 1of 3

Data Types in PeopleCode

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.

1/3

Data Types in PeopleCode

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 saysthe date with the timeand 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 workingand 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

2/3

Data Types in PeopleCode

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.

3/3

You might also like