Random postings about IBM Informix

-710 error test code

This is the code I use to test the five scenarios where a -710 error can occur.

#!/usr/bin/perl

use strict;
use warnings;
use DBI;

# Requires a working DBD::Informix environment.
# Requires a database called testdb to which you have at least the resource privilege.
# The script logs in using your local user; edit function dbconnect to use an explicit user name or password

# 1. $prepare s1 from "select c1, c2 from t710";$execute s1;$create index i1 on t710(c1);$execute s1; -------> -710 error
# 2. $prepare s1 from "select * from t710 where c1 = 10";$declare curs1 cursor for s1;$create index i1 on t710(c1);$open curs1; -------> -710 error
# 3. create procedure p1(c_a int, c_b int) returning integer;insert into A values(1001, 1001);update A set b=c_b where A.a=c_a; ==>(You have an update trigger defined on A which inserts into table Breturn 0;end procedure; create procedure p2() returning integer;define i integer;let i=p1(56, 56);create index i1 on B(b);return p1(56, 56); -- > -710 error when p1 is executedend procedure;
# You can still get -710 errors in your applications in one of the following scenarios:
# 4. The number and type of columns in your SELECT list have changed.
# 5. If you are executing a prepared DDL statement, you might get -710 errors.