shlogg · Early preview
Judy @esproc_spl

Finding Primary Key Value In SPL Script

Find member with ID 5: Connect to db (A1), retrieve Category table (A2) & set ID as PK. Use pfind() to find record with PK value 5.

In the following product category table, ID field is the primary key. The task is to find the member whose ID field value is 5.

SPL script:

A1 Connect to the database;
A2 Retrieve Category table from the database and set ID as the primary key;
A3 Find the record whose primary key value is 5. If the 
desired primary key value does not exist or no primary key is defined, pfind() function returns null.
SPL open source address
Download