SPL-Error 305
Posted in 1996
Topics: Stored Procedures & SPL, Server Administration, Data Types & Schema Design
Hello,
I have again some weird problems with SPL.
My program looks like this:
1 dbaccess flip22 << ...
2
3 create temp table mytable (mycol char(10));
4 insert into mytable values ("abcdefghij");
5
6 create procedure myproc ()
7 -- define xy char(10);
8 define xy like mytable.mycol;
9
10 set debug file to "myproc.trace";
11 foreach select mycol into xy from mytable
12 trace "Value="|| xy[1,4];
13 end foreach
14 end procedure;
15
16 execute procedure myproc ();
17 drop procedure myproc;
18 ...
Informix says:
305: Subscripted column (xy) is not of type CHAR, VARCHAR,TEXT nor BYTES
But when I define this way "DEFINE xy CHAR(10);", everything works.
Can somebody tell me why Informix doesn't see the char-type of mycol?
And by the way, is there a smart way to define a whole table, instead
of defining each column!?
TIA, Michael
So