How do you break a while loop in PeopleCode?

How do you break a while loop in PeopleCode?

At any point during a looping construct, you can exit the loop entirely via the use of the ‘Break’ function. Even if the loop condition has not been met, the ‘Break’ will terminate the code immediately and resume control after the loop.

How do I add PeopleCode?

When inserting rows using PeopleCode, you can either use the Insert method with a record object or create a SQL Insert statement using the SQL object. If you do a single insert, use the Record Insert method. If you are in a loop and,therefore, calling the insert more than once, use the SQL object.

How do you end a loop after one iteration?

Tips

  1. The break statement exits a for or while loop completely. To skip the rest of the instructions in the loop and begin the next iteration, use a continue statement.
  2. break is not defined outside a for or while loop. To exit a function, use return .

What is Meta-SQL in PeopleSoft?

Meta-SQL is a great way to abstract SQL logic and ensure consistency in your SQL definitions. It isn’t just for database platform independence, it is actually a better way to write SQL for PeopleSoft.

How do I get Sysdate in PeopleCode?

}PeopleCode. select to_char(sysdate,’dd’) from dual; should get you the day.

How do you populate values in Peoplesoft grid?

The grid is placed on level 1 of a secondary page and is populated using Peoplecode written in the Activate event of the secondary page. We use the SQL object &VCHRS_GRD_SQL to fetch some Voucher IDs and Vendor IDs from the database and populate the grid with these values.

What executes first in a do-while loop?

The do-while loop is an exit-condition loop. This means that the body of the loop is always executed first. Then, the test condition is evaluated. If the test condition is TRUE, the program executes the body of the loop again.

What is the SQL class in PeopleCode?

PeopleCode provides the SQL class for accessing these SQL definitions in your PeopleCode program at runtime. The SQL class provides capability beyond that offered by SQLExec. Unlike SQLExec, which fetches just the first SELECTed row, operations for the SQL class allow iteration over all rows fetched.

What is PeopleCode syntax?

In its fundamentals, PeopleCode syntax resembles other programming languages. Some aspects of the PeopleCode language, however, are specifically related to the PeopleTools environment.

What is a ‘while’ loop in PeopleCode?

A typical instance of using a ‘while’ loop in PeopleCode is for uploading records from a flat file. The programme does not know in advance how many lines are about to be read in: Similarly, a ‘while’ loop is commonly used when doing a ‘Fetch’ from an SQL select:

How do I declare a variable in PeopleCode?

The variable is valid for the duration of the PeopleCode program or function in which the variable is defined. You can declare variables using the Global, Local, or Component statements, or you can use local variables without declaring them. Here are some examples: