PUT insert cursor-HELP.
Posted in 1999
Topics: Error Codes & Troubleshooting, Connectivity: ESQL/C, 4GL & Embedded SQL, Clustering, Grid & MACH11, Versions, Editions & End-of-Life
Hi Informixer, I am working on a fixed length file loading process that basically extracting some specific information from this file and then insert them into a newly created table, namely 'mytable'. Here is my current logic (in ESQLC): _________________________________________________ while reading A file { extracting field1, field2, field3 from A. $put ins_cursor from :mystruct /* skip duplicate records */ if (SQLCODE==-268 || SQLCODE==-269||SQLCODE==-239) {SQLCODE==-269||SQLCODE==-239) { continue; } } /* end while */ $flush ins_cursor; $close ins_cursor cursor; $free ins_cursor cursor; ____________________________________________________ The program has no compiling errors. However, it skipped some records at SQLCODE==-239 level even there is no duplicated records in 'mytable'. Is something wrong with my logic ??? Any ideas or sugesstions ??? I/m using IDS 7.3/INFORMIX-ESQL Version 9.14. Here is 'mytable' structure: Column name Type Nulls acctno char(10) no detail_num char(10) no discontinue_date char(8) no Index name Type Cluster Columns myidx unique No srms_acctno detail_num Thanks advance for your advise. TN --------------------------------------------------- Get free personalized email at http://www.iname.com
Looks mostly OK to me. It is hard to tell from the pseudo code but it may be that if the read were positioned after the 'if (SQLCODE...' test that the continue would cause in infinite loop of attempting to reinsert the same duplicated row over and over if any duplicate occurs. Otherwise I don't see anything wrong. Art S. Kagel thain@writeme.com wrote: > > Hi Informixer, > > I am working on a fixed length file loading process that > basically extracting some specific information from this > file and then insert them into a newly created table, namely 'mytable'. Here is my current logic (in ESQLC): > _________________________________________________ > while reading A file { > extracting field1, field2, field3 from A. > $put ins_cursor from :mystruct > /* skip duplicate records */ > if (SQLCODE==-268 || SQLCODE==-269||SQLCODE==-239) {SQLCODE==-269||SQLCODE==-239) { > > continue; > } > } /* end while */ > $flush ins_cursor; > $close ins_cursor cursor; > $free ins_cursor cursor; > ____________________________________________________ > > The program has no compiling errors. However, it skipped some records at SQLCODE==-239 level even there is no duplicated records in 'mytable'. Is something wrong with my logic ??? Any ideas or sugesstions ??? > I/m using IDS 7.3/INFORMIX-ESQL Version 9.14. > Here is 'mytable' structure: > > Column name Type Nulls > acctno char(10) no > detail_num char(10) no > discontinue_date char(8) no > > Index name Type Cluster Columns > myidx unique No srms_acctno > detail_num > Thanks advance for your advise. > > TN > > --------------------------------------------------- > Get free personalized email at http://www.iname.com