I have one record in my item table with i_id=1. I wrote a storedprocedure to get i_title for items whose i_id=1, which works fine. But if I add 'stop' command(marked as ===>), it returns junk in my output parameter, and error message: SQL state: S1000 SQL code: 2 SQL Errortext: [SAP AG][LIBSQLOD SO][SAP DB]General error;2 POS(1) stop2. My understanding the way stop should work is: while returning the first i_title1, print out 'stop2' indicating it has stopped.
Am I missing something? Thanks, Jenny CREATE DBPROC getItem (OUT count fixed(2,0), OUT i_title1 varchar(60), OUT i_title2 varchar(60), OUT i_title3 varchar(60)) AS BEGIN set i_title1=''; set i_title2=''; set i_title3=''; set count=0; select i_title from tpcw.item where i_id=4; if $rc=0 then begin fetch into :i_title1; end; if $rc=0 then begin set count=count+1; fetch into :i_title2; end ===>else stop(1, 'stop1'); if $rc=0 then begin set count=count+1; fetch into :i_title3; end ===>else stop(2, 'stop2'); END; ; _______________________________________________ sapdb.general mailing list [EMAIL PROTECTED] http://listserv.sap.com/mailman/listinfo/sapdb.general
