SPL on exception in loop
Posted in 1993
Hey folks, in case you were bored with our other question.... Today's question #2 is about the on exception statement with SPL (stored procedure language): What we want to do is trap an error and continue with the next iteration of reading through a table with a foreach loop. The manual clearly states that you can do this, we just can't get it to work. To review SPL a bit, on exception must come BEFORE the sql statement that you want to trap. But if you do this: on exception blah blah blah end exception (with or without resume) foreach select etc... end foreach next line of code You will execute "next line of code" immediately after trapping the error. So, the book says put your on exception within the foreach loop. But this seems to be syntactically impossible. You cannot say: foreach on exception etc end exception select 'cause the foreach wants some to "foreach" about... Please help. Thanks. If you care... online & istar 5.0 on a Sequent 2000 with ptx 2.0.4. We talk to it using inet-pc 4.10 and powerbuilder running on windows. -- Scott F. Ford, Data Base Administrator | sford@wvus.org bps (Benefit Panel Services) | elroy.jpl.nasa.gov!wvus!sford 888 South Figueroa Street, Suite 1400 | Voice: (213) 489-2694 Los Angeles, CA. 90017 | FAX: (213) 489-7973 "...The bozone layer: shielding the rest of the solar system from the earth's harmful effects...."