Re: FOREACH syntax error
Posted in 1995
Jack, Here's my guess. I've run into the same problem when the Informix couldn't tell the difference between my column names and my variable names. You might try qualifying each of the column names in your DECLARE. If that doesn't help look manually for variable names which match column names. (I'd say filename is a good candidate!) --Craig (craig@chemistry.utah.edu) } } Interesting problem (at least to me). I have a cursor: } } DECLARE ct_curs CURSOR FOR } SELECT filename, colname, coltype, collength } FROM source_tables, source_columns } WHERE source_tables.file_id = source_columns.file_id } AND source_tables.end_date IS NULL } ORDER BY filename, colname } } and a simple FOREACH loop; } } LET c_idx = 1 } FOREACH ct_curs INTO col_rec[c_idx].tabname, col_rec[c_idx].colname, } col_rec[c_idx].coltype, col_rec[c_idx].collength } LET col_rec[c_idx].tag = '' } LET c_idx = c_idx + 1 } IF c_idx > 1000 THEN } EXIT FOREACH } END IF } END FOREACH } } This works fine by itself. When I use the same code in a bigger and finer } program I get a -201 syntax error on the FOREACH. Checking the .ec code } it appears that it doesn't like trying to open the cursor. } } Obviously there is some piece of code nested in the 4000+ odd lines that is } causing this problem. I have no idea what it is. My standard debugging } technique involves ripping things out until the pain stops. Does this } ring a bell for anyone? In other words does anyone have some idea what } I should be looking for? }