Links may not function; however, this content may be relevant to outdated versions of the product.
Inserting data records by using SQL
Use the ExecuteRDB SQL API to insert multiple records into your internal database in a batch through an activity. The ExecuteRDB SQL API directly inserts records in your database without requiring you to create a data object in Pega Platform.
In the header of Dev Studio, click
.In the activity rule form, enter a label, select an application and the associated ruleset, and then click Create and open.
On the Steps tab, in the Label field, enter a unique identifier for the step.
In the Method list, select Java.
To the left of the Method list, click the Expand icon.
In the Method Parameters section, in the Java Source field, enter an ExecuteRDB method.
For example:
<YourClassName> is the name of the class into which you want to insert records.String sql = "insert into {class:" + <YourClassName> + "} values ('a','b')"; ClipboardPage listPage = tools.getThread().createPage("Code-Pega-List", "MyPage"); listPage.putString("pxObjClass", <YourClassName>); listPage.putString(".pyMaxRecords", String.valueOf(0)); try{ tools.getDatabase().executeRDB(sql, listPage)); }catch(Exception err) { oLog.infoForced("Exception occurred"); }
Click Save.
Start the insert of records into your internal database by running the activity.
Previous topic Managing your data model through SQL Next topic Updating data records by using SQL