Re: DBD::Informix and SELECT from MULTISET column

Re: DBD::Informix and SELECT from MULTISET column

am 15.02.2007 15:27:55 von tvilliers

On 23 Sep 2005, 16:23, tvilli...@gmail.com wrote:
> I'm looking for a bit more information WRT the returned dataset from
> selecting from a MULTISET column in Informix please.
>
> Create a small table:
> "create table test (col1 int,col2 multiset(int not null))"
> and insert a couple of rows of test data (eg, "1, {2,3}" etc)
>
> When I use this test script:
>
> _BEGIN_
> use DBI;
> use DBD::Informix qw(:ix_types);
> my $dbh = DBI->connect(...);
> my $sth = $dbh->prepare('SELECT col2 FROM test');
> $sth->execute();
> my $col2;
> $sth->bind_col(1, \$col2, { TYPE => 'IX_MULTISET'} );
> while ( my $row = $sth->fetchrow_hashref() ) {
> print "$col2\n";}
>
> $sth->finish();
> $dbh->disconnect;
> _END_
>
> the returned resultset is "flat":
> "
> MULTISET{1,2}
> ...
> "
>
> I "expected" a reference to an object (an array); or how else would I
> achieve such a result?
>

It's been a while since the post above, but I'd still appreciate any
pointers.

Also, when the returned MULTISET column exceeds 256 bytes, it gets
truncated, even though the data type is explicitly bound as in the
previous example.

I've tried setting the LongReadLen attribute, but it doesn't seem to
make any difference to the result either.

--tielman