SQL Language Guide : 8. SQL Statements : ENDSELECT : ENDSELECT Example
 
Share this page                  
ENDSELECT Example
Break out of a select loop on a data loading error:
exec sql select ename, eno into :ename, :eno
        from employee;
exec sql begin;
        load ename, eno into data set;
        if error then
        print 'Error loading ', ename, eno;
        exec sql endselect;
        end if
exec sql end;
/* endselect transfers control to here */