You can use ARRAY_GET(x,1) to retrieve individual values from an ARRAY. There is currently no way to retrieve multiple values.

You will need to do something like
SELECT ARRAY_GET(x,1) || ',' || ARRAY_GET(x,2)

On 2014-08-18 07:19 PM, Vijit Jain wrote:

I have an issue with displaying multiple array contents using a single runtool 
script.

These are the steps that might help you to recreate the issue i encountered.


1. using runtool, against a database, in which, there is a column which is an 
Array. Containing at least 4-6 values.

2. Now, try to perform a csvwrite against this database, and print a range of 
array values, say from array[0] to array[5].
3. It seems like it is not possible yet....as the tutorial on the website, did 
not provide much information about fetching range values.


I expected to see acsv file, which would have printed the array contents from 
position 0 to position 5 on each row.

Instead, saw an error
Exception in thread "main" org.h2.jdbc.JdbcSQLException: Syntax error in SQL statement "SELECT 
TIME,SYMBOL,CP,Array1[1,[*]2],Array2[1,2],Array3[1,2],Array4[1,2] FROM Table WHERE Search='XYZ' "; 
expected "[, ::, *, /, %, +, -, ||, ~, !~, NOT, LIKE, REGEXP, IS, IN, BETWEEN, AND, OR, ]"; SQL 
statement:

I am Using version H2 1.4.180

Any help would be appreciated.

thanks.

--
You received this message because you are subscribed to the Google Groups "H2 
Database" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to
[email protected] 
<mailto:[email protected]>.
To post to this group, send email to [email protected] 
<mailto:[email protected]>.
Visit this group at http://groups.google.com/group/h2-database.
For more options, visit https://groups.google.com/d/optout.

--
You received this message because you are subscribed to the Google Groups "H2 
Database" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/h2-database.
For more options, visit https://groups.google.com/d/optout.

Reply via email to