Using Expressions in PS Query
Expressions in PeopleSoft Query are based on the functions and capabilities of the underlying database platform. For instance, if you are using the Oracle database, you can make use of Oracle SQL functions in your Query, if using SQL Server - you can use SQL Server's SQL functions and so on.
Although there are SQL standards, many of the SQL functions are not part of those standards. For this reason, the expressions listed below are Oracle SQL functions (hope to include SQL Server and other plaforms later).
Oracle SQL Functions in PeopleSoft Query
Function: || (Concatenate)
Usage: 'Putting ' || A.COLUMN || ' and strings together'
This concatenates (puts together) column values and fixed character values. This has got to be one of the most useful functions.
'PS_' || A.RECNAME /* Gives the standard table name from the record name. */
This extracts a part of a text column.
Substr(A.DESCR,3) /* The description without the first three characters */
Translates characters in the column found in first list with corresponding character in the second list.
Show the format of NATIONAL_ID - useful in a group by query:
translate(NATIONAL_ID, '0123456789' ||'abcdefghijklmnopqrstuvwxyz'||'ABCDEFGHIJKLMNOPQRSTUVWXYZ' ,rpad('9',10)||rpad('x',26) ||rpad('X',26)) /* Format of NATIONAL_ID */ translate(DESCR,'-0123456789','-') /* Removes digits from descriptiont field. */
More About Functions
|For more information about functions in PeopleSoft Query and some other interesting stuff too, read our eBook:|