Here ya go.
CREATE DBPROC REASSIGN_PENDING(IN SUSER VARCHAR(10)) AS
VAR callid INTEGER;
SET callid = 0;
DECLARE c1 CURSOR FOR select a.call_id from idb.call a inner join
idb.company b on a.company_id = b.company_id where (a.assign_to = 'jpl' and
a.status = 'PENDING' and (b.territory_code = '520' or b.territory_code =
'620'));
WHILE ($rc = 0) DO
BEGIN
FETCH c1 INTO :callid;
IF $rc = 0 THEN
UPDATE IDB.CALL SET ASSIGN_TO = :SUSER WHERE CALL_ID =
:callid;
END;
CLOSE c1;
-----Original Message-----
From: Flavio Silveira [mailto:flavio.silveira@stripped]
Sent: Monday, June 06, 2005 3:26 PM
To: MaxDB: List
Subject: Procedure
I'd like to write a procedure in MaxDB but I have doubts about the sintaxe.
A procedure have to have a cursor that selects some rows in a table. For
each fetch of the cursor I have to update some columns in this table.
Anybody have a example of a procedure to send me? The documentation on the
site www.mysql.com/maxdb is not good about procedures, functions and stuff.
Thanks,
Flávio.
| Thread |
|---|
| • Procedure | Flavio Silveira | 6 Jun |
| • RE: Procedure | Kevin Wilson | 6 Jun |