Oracle/PL SQL curosr%notfound equivalent in Teradata?

For detailed information about the CURSOR handling/behaviour in Teradata see page 47 in info.teradata.com/do_redirect.cfm?itemid=062....

Up vote 1 down vote favorite share g+ share fb share tw.

If not, then how can I translate below code to run in Teradata. OPEN OPEN_CUR1; LOOP FETCH OPEN_CUR1 INTO ... some variables ...; EXIT WHEN OPEN_CUR1%NOTFOUND; CLOSE OPEN_CUR1; Thanks oracle stored-procedures plsql cursor teradata link|improve this question asked Nov 1 '11 at 7:30Ali1077 67% accept rate.

For detailed information about the CURSOR handling/behaviour in Teradata see page 47 in info.teradata.com/do_redirect.cfm?itemid=062... Basically the equivalent to OPEN_CUR1%NOTFOUND from Oracle in Teradata is that SQLSTATE is set to 7362 and the SQLCODE to '02000'... for handling this you can check pages 49, 76, 192-198, 405 ff. Of the above document. EDIT - as per comment: From the example on page 49 CREATE PROCEDURE sp1 (OUT par1 CHARACTER(50)) BEGIN DECLARE var1 INTEGER; DECLARE projcursor CURSOR FOR SELECT projid, projectdesc FROM project; OPEN projcursor; WHILE (SQLCODE = 0) FETCH projcursor INTO var1, par1; END WHILE; FETCH projcursor INTO var1, par1; CLOSE projcursor; END; They use WHILE (SQLCODE = 0) which means basically "while everything is fine and data is available".

Thanks for you prompt response and sharing the documentation. I have already gone through the documentation, but I wanted a precise example that what can replace cursor not found. Is there any SQLState that will suffice?

– Ali Nov 1 '11 at 8:22 see my EDIT above... I still strongly recommend to read the parts about SQLSTATE HANDLERs etc. – Yahia Nov 1 '11 at 8:28.

I cant really gove you an answer,but what I can give you is a way to a solution, that is you have to find the anglde that you relate to or peaks your interest. A good paper is one that people get drawn into because it reaches them ln some way.As for me WW11 to me, I think of the holocaust and the effect it had on the survivors, their families and those who stood by and did nothing until it was too late.

Related Questions