MySQL Forums
Forum List  »  Oracle

Re: How to convert this Oracle PL/SQL Function to MySQL
Posted by: Roland Bouman
Date: October 14, 2005 06:49AM

CREATE OR REPLACE FUNCTION DESC2RPT000105_FUNC (
INRPT101ID VARCHAR(put the length here)
, INRPT104ID VARCHAR(put the length here)
)
RETURNS VARCHAR(put the length here)
begin
declare MYCURSOR CURSOR FOR
SELECT DESCRIPTION
FROM RPT000105
WHERE RPT000101ID = INRPT101ID
AND RPT000104ID = INRPT104ID
AND STRIP <> 'Y'
;
declare VRET VARCHAR(500);
declare description VARCHAR(500);
declare done bool default false;
declare continue handler for not found set done := true;

set VRET := '';
open MYCURSOR;
LOOP_MYCURSOR: loop
fetch MYCURSOR
into description
;
if done then
close MyCURSOR;
if vret <> '' then
set vret := left(VRET,character_length(vret)-1);
end if;
leave LOOP_MYCURSOR;
end;
set vret := concat(vret,rtrim(description),'/');
end loop;
RETURN vret;
END;

Options: ReplyQuote


Subject
Views
Written By
Posted
43885
January 03, 2005 10:56PM
25664
February 10, 2005 05:20PM
12661
August 26, 2005 03:28AM
11304
March 09, 2006 06:57AM
10602
March 09, 2006 02:09PM
7865
June 20, 2006 06:42PM
Re: How to convert this Oracle PL/SQL Function to MySQL
26000
October 14, 2005 06:49AM
6322
January 23, 2006 10:37AM
5213
January 23, 2006 02:26PM
4710
September 30, 2006 01:18AM
5155
February 06, 2007 12:17AM


Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.