All pastes #611 Raw Edit

plsql cursor

public sql v1 · immutable
#611 ·published 2004-08-13 13:09 UTC
rendered paste body
CREATE OR REPLACE FUNCTION visib.jr_so_header_text(so char) return char is             so_header_text varchar(2000);             temp varchar(20);  cursor so_text_cursor is    	select          	rtrim(t1.comment_text) || ' '         from 	         	visib.s_odetails t1         where     		t1.salesorderno = so 	and 	t1.lineno_alt = '000' 	order by  		t1.seq_num asc ; 	 BEGIN         			 so_header_text := ' ' ;       	open so_text_cursor;          	loop                  	fetch so_text_cursor into temp;                  	so_header_text := so_header_text || temp ; 					temp := '' ;                  	exit when so_text_cursor%NOTFOUND;                  end loop;          close so_text_cursor;   /*	so_header_text := 'jr_test';  */   return so_header_text;   EXCEPTION    	WHEN OTHERS then    	so_header_text := '(??)';    	return so_header_text;    end;/