problems with esqlc - collection variables
Posted in 1998
Hello, I tried to compile the following code that uses a collection variable and I always get error messages because collection variables are unknown. It is the same problem when I declare row, list - variables. Is there anyone, who can help me ? 1 Exec Sql 2 include sqlca; 3 #include <stdio> 4 Exec Sql 5 include collct.h; 6 Exec Sql Begin Declare Section; 7 client collection set(char(30) not null) set_var; 8 int set_anz; 9 char attribut[51] ; 10 Exec Sql End Declare Section; 11 main() 12{ 13 Exec Sql allocate collection :set_var; 14 Exec Sql connect to "altemuenzen"; 15 Exec Sql select Attribute, cardinality(Attribute) into :set_var :set_anz from Motive where Id=5; 16 Exec Sql Declare crs_attribut cursor for select * from table (:set_var); 17 Exec Sql Open crs_attribut; 18 for(i=0; i<set_anz; i++) 19 { 20 Exec Sql fetch crs_attribut into :attribut; 21 printf("Attribut = %s", attribut); 22 } 23 Exec Sql close crs_attribut; 24 Exec Sql free crs_attribut; 25 } line 7: Invalid satement on symbol 'client' Syntax error on identifier or symbol 'set' line 13: Syntax error on identifier or symbol 'collection' line 15: Object 'set_var' was not declared. line 16: Syntax error on identifier or symbol '(' Thanks in advanced Ilona