"Wilson, Doug" wrote:
> AFAIK, DBD::Informix does not (yet?) handle complex
> data types such as LIST.
>
Basically correct; probably extra true of the 0.97005 pre-release for
1.00.PC1.
It is high on the priority list of things to be fixed -- actually, support for
IUS types (of which LIST is one) is at the top of the priority list of things
to be fixed. However, it isn't as simple as I'd like it to be, by a large
margin. In fact, it probably involves rewriting the core of DBD::Informix to
use sqlda structures instead of SQL descriptors.
One item you could check is whether the LIST{2} is passed through to the DBMS
correctly. Set SQLIDEBUG=2:dbdix and run the test code. Then run sqliprint
on the resulting file (eg dbdix_1234). Look to see whether the {2} is
stripped as a comment. If it is, then you know what one of the problems is --
the sqltoken() routine is not aware of this construct which looks like a
comment. The SQLCMD code at the IIUG web site (http://www.iiug.org) has an
iustoken() routine in iustoken.c which deals with this particularly nasty
piece of tokenization. You'd have to bolt that into the DBD::Informix -- and
this would apply equally to version 1.00.PC1.
Also, when you say "DB pops assertion failure", do you mean that the database
server does an assertion failure, or do you mean that DBD::Informix makes the
assertion failure. Either could be a valid interpretation of your comment...
> -----Original Message-----
> From: James Maes [mailto:[EMAIL PROTECTED]]
> Sent: Tuesday, May 22, 2001 11:22 AM
> To: [EMAIL PROTECTED]
> Subject: Informix : LIST type, DB pops Assertion Failure
>
> Informix 9.2UC1 w/ WebData Blades
> DBD::Informix 0.97005
> DBI 1.13
>
> Having some problems with the LIST datatype w/ Informix.
>
> The problem is that the database pops an Assertion Failure with the code I
> have below. It works fine from dbaccess, just not with DBI.
>
> Does anyone know if this is a known problem with DBD::Informix, or the
> engine
> or ......
>
> See example code below:
>
> #!/usr/bin/perl
>
>
>
> BEGIN
> {
> require "/usr/informix/projects/lib/libp.pm";
> };
>
>
>
> $lib = new libp();
> $dbh = $lib->OpenDB();
>
>
> ###############################
> ## create temp table to test ##
> ###############################
> $temp_table_id = "list_row_test" . $$;
> print "Creating test table\t[$temp_table_id]\n";
> $table_sql = qq{
> CREATE TEMP TABLE $temp_table_id
> (
> id serial,
> name varchar(25),
> list LIST(INTEGER NOT NULL)
> )
> };
>
> $lib->SQLQuery($dbh, $table_sql);
> $dbh->commit();
>
>
>
> ###########################
> ## insert some test data ##
> ###########################
> $insert_sql = qq{
> INSERT INTO
> $temp_table_id
> (
> id,
> name,
> list
> )
> VALUES(100,"David",LIST{2})
> };
>
> @values = (100,"David","202");
> $lib->SQLQuery($dbh, $insert_sql);
> $dbh->commit();
>
>
> #################################
> ## select test data from table ##
> #################################
> $select_sql = qq{
> SELECT
> *
> FROM
> $temp_table_id
> };
>
>
> $st1 = $lib->SQLQuery($dbh, $select_sql);
> while($data = $st1->fetchrow_hashref())
> {
> $lib->print_ds(\$data);
> }
>
>
> $lib->CloseDB($dbh);
>
> Thanks
>
> --
>
> ------------------------------------
> || James Maes
> || Senior Programmer
> || [EMAIL PROTECTED]
> || The Sporting News
> || www.sportingnews.com
> || fantasy.sportingnews.com
> || radio.sportingnews.com
> ------------------------------------
>
> "given enough time and resources we can accomplish anything"
Now there's a quote I can relate to!
--
Jonathan Leffler ([EMAIL PROTECTED], [EMAIL PROTECTED])
Guardian of DBD::Informix 1.00.PC1 -- see http://www.cpan.org/
#include <disclaimer.h>