Trimming the array (TRIM_ARRAY function)
Trimming an array is a task that you would perform using the TRIM_ARRAY function when you want to remove unnecessary array elements from the end of an array.
Before you begin
- Read: Array data types
- Read: Restrictions on array data types
- Privileges required to execute the SET statement
About this task
Procedure
Results
Example
phones index 0 1 2 3
phone '416-223-2233' '416-933-9333' '416-887-8887' '416-722-7227'
After
executing the following: SET phones = TRIM_ARRAY ( phones, 2 );
The
array, phones, will be defined as:phones index 0 1
phone '416-223-2233' '416-933-9333'
What to do next
- Verify the SQL statement syntax of the SET statement and execute the statement again.
- Verify that the local variable is of the correct data type.
- Verify that the array was created successfully and currently exists.