Logo

dev-resources.site

for different kinds of informations.

Getting members according to primary key values #eg63

Published at
10/22/2024
Categories
database
sql
esproc
spl
Author
esproc_spl
Categories
4 categories in total
database
open
sql
open
esproc
open
spl
open
Author
10 person written this
esproc_spl
open
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

Featured ones: