DEV Community

Judy
Judy

Posted on

Getting members according to primary key values #eg63

In the following product category table, ID field is the primary key. The task is to find ordinal numbers of members whose ID field values are 5, 7 and 10 respectively.

Image description
SPL script:

Image description
A1 Connect to the database;
A2 Retrieve Category table from the database and set ID as the primary key;
A3 Find records whose primary key values are 5, 7 and 10 respectively and return a record sequence consisting of the three records. @k option treats the sequence type parameter passed in as a sequence of key values, which enables the function to return a sequence of multiple matching records.

SPL open source address

Download

Top comments (0)