![]() | ![]() Products ![]() ![]() ![]() ![]() |
Home » Technical Support » ElevateDB Technical Support » Product Manuals » ElevateDB Version 2 SQL Manual » SQL/PSM Functions » COLUMNCOUNT |
COLUMNCOUNT(<CursorName>) <CursorName> = Previously-opened result set cursor
INTEGER
-- This procedure returns a semicolon-delimited -- string containing the column names for a given table CREATE FUNCTION ColumnNames(IN TableName VARCHAR COLLATE ANSI_CI) RETURNS VARCHAR COLLATE ANSI_CI BEGIN DECLARE ResultCursor SENSITIVE CURSOR FOR Stmt; DECLARE I INTEGER; DECLARE ResultColumnCount INTEGER; DECLARE Result VARCHAR DEFAULT ''; PREPARE Stmt FROM 'TABLE '+QUOTEDSTR(TableName,'"'); OPEN ResultCursor; SET I=1; SET ResultColumnCount=COLUMNCOUNT(ResultCursor); WHILE I <= ResultColumnCount DO IF Result <> '' THEN SET Result=Result+';'; END IF; SET Result=Result+COLUMNNAME(ResultCursor,I); SET I=I+1; END WHILE; CLOSE ResultCursor; RETURN Result; END
Deviation | Details |
Extension | This function is an ElevateDB extension. |
This web page was last updated on Friday, January 31, 2025 at 08:42 AM | Privacy Policy![]() © 2025 Elevate Software, Inc. All Rights Reserved Questions or comments ? ![]() |