Login ProductsSalesSupportDownloadsAbout |
Home » Technical Support » ElevateDB Technical Support » Product Manuals » ElevateDB Version 2 SQL Manual » Array Functions » CARDINALITY |
CARDINALITY(<ArrayExpression>) <ArrayExpression> = Any array of type: CHARACTER|CHAR CHARACTER VARYING|VARCHAR GUID BYTE BYTE VARYING|VARBYTE BINARY LARGE OBJECT|BLOB CHARACTER LARGE OBJECT|CLOB BOOLEAN|BOOL SMALLINT INTEGER|INT BIGINT FLOAT DECIMAL|NUMERIC DATE TIME TIMESTAMP INTERVAL YEAR INTERVAL YEAR TO MONTH INTERVAL MONTH INTERVAL DAY INTERVAL DAY TO HOUR INTERVAL DAY TO MINUTE INTERVAL DAY TO SECOND INTERVAL DAY TO MSECOND INTERVAL HOUR INTERVAL HOUR TO MINUTE INTERVAL HOUR TO SECOND INTERVAL HOUR TO MSECOND INTERVAL MINUTE INTERVAL MINUTE TO SECOND INTERVAL MINUTE TO MSECOND INTERVAL SECOND INTERVAL SECOND TO MSECOND INTERVAL MSECOND
INTEGER
-- This script loops through the Customer table and -- populates an array with the CustNo column value -- for each row SCRIPT BEGIN DECLARE Done BOOLEAN DEFAULT False; DECLARE TotalRows INTEGER DEFAULT 0; DECLARE CustCursor CURSOR FOR CustStmt; DECLARE CustArray INTEGER ARRAY [56]; SET LOG MESSAGE TO CAST(CARDINALITY(CustArray) AS VARCHAR); PREPARE CustStmt FROM 'SELECT CustNo, Company FROM Customer'; OPEN CustCursor; WHILE (NOT EOF(CustCursor)) DO SET TotalRows=TotalRows+1; FETCH NEXT FROM CustCursor INTO CustArray[TotalRows]; SET PROGRESS TO TRUNC((TotalRows/ROWCOUNT(CustCursor))*100); END WHILE; SET LOG MESSAGE TO CAST(CARDINALITY(CustArray) AS VARCHAR); CLOSE CustCursor; END
Deviation | Details |
Referenced Elements | ElevateDB sets the cardinality of an array on any array access to a specific index, not just the assignment of a value to a specific index. |
This web page was last updated on Thursday, November 16, 2023 at 10:39 AM | Privacy PolicySite Map © 2024 Elevate Software, Inc. All Rights Reserved Questions or comments ? E-mail us at info@elevatesoft.com |