Re: Error code -406 & -408
Posted in 1993
Topics: SQL Development & Query Writing, Stored Procedures & SPL, Error Codes & Troubleshooting, Connectivity: ESQL/C, 4GL & Embedded SQL, Migration, Import/Export & Data Conversion
} } Hi, } } We port customer's AP to DEC 3000/400 OSF/1, but we get some Informix } ESQL/C error code 406 and 408. Could you someone can give us the suggestion } or ideal for this problem ? } } Pls refer to the attachment source file and result of error code. } } Thanks, and Regards } Steve Hsu } Internet Address : stevehsu@tpovc.enet.dec.com } I think the problem is with your prepare. The program prepares 8000 times the same select statement and not freeing the statement being prepared. Try $free cur_pid after the $close cur_sp statement Or try (code changed starts with !! code added starts with @@) deleted stuff ....... @@static int prep_flg = 0; } sprintf(seloi,"select splno,spano,spo_loc,spi_loc,sp_date,spsta,\\ } sp_length,sp_resid,sp_dblos,sp_rate,sp_unit,\\ } sp_sect,sp_route,sp_class,sp_spec,sp_sta \\ } from spdat01 where splsq=%d", no_reco); !! sprintf(seloi,"select splno,spano,spo_loc,spi_loc,sp_date,spsta,\\ !! sp_length,sp_resid,sp_dblos,sp_rate,sp_unit,\\ !! sp_sect,sp_route,sp_class,sp_spec,sp_sta \\ !! from spdat01 where splsq=?"); @@if (!prep_flg) { /* Prepare only once */ } $prepare cur_pid from $seloi; } if(sqlca.sqlcode != 0) } { } fprintf(stderr,"$prepare => # = %d, sqlcode = %d\\r", } no_reco, sqlca.sqlcode); } return(sqlca.sqlcode); } } } $declare cur_sp cursor for cur_pid; } if(sqlca.sqlcode != 0) } { } fprintf(stderr,"$declare => # = %d, sqlcode = %d\\r", } no_reco, sqlca.sqlcode); } return(sqlca.sqlcode); } } @@prep_flg = 1; @@} } $open cur_sp; !!$open cur_sp using $no_reco; } if(sqlca.sqlcode != 0) } { } fprintf(stderr,"$open => # = %d, sqlcode = %d\\r", } no_reco, sqlca.sqlcode); } return(sqlca.sqlcode); } } } $fetch cur_sp into $splno,$spano,$spo_loc,$spi_loc,$sp_date,$spsta, } $sp_length,$sp_resid,$sp_dblos,$sp_rate,$sp_unit, } $sp_sect,$sp_route,$sp_class,$sp_spec,$sp_sta ; } if(sqlca.sqlcode != 0) } { } fprintf(stderr,"$fetch => # = %d, sqlcode = %d\\n", } no_reco, sqlca.sqlcode); } } } err=sqlca.sqlcode; } $close cur_sp; } return(err); } } } deleted stuff here..... Hope this helps. +---------------------------+--------------------------+ | G.T.Madavan, | e-mail: gtmad@smi.mn.org | | Systems Migration Inc., | Phone : (612) 890-0040 | | Burnsville, MN, U.S.A | Fax : (612) 890-0966 | +---------------------------+--------------------------+