The Carray() Table-Valued Function
The Carray() Table-Valued Function
1. Overview
Carray($PTR,$N) is a table-valued function with a single column (named "value") and zero or more rows. The "value" of each row in the carray() is taken from a C-language array that is $N elements long and begins at address $PTR. In this way, the carray() function provides a convenient mechanism to bind C-language arrays to SQL queries.
2. Availability
The carray() function is not compiled into SQLite by default. It is available as a loadable extension in the ext/misc/carray.c source file.
The carray() function is dangerous. The first parameter is a 64-bit integer which gets cast into a pointer to