0

how can fetch record from query with out using cursor if we have multiple results are there can we do this like the following code

FOR r IN (SELECT a,b,c FROM tabel WHERE a=1) LOOP SHOW (r.a); END LOOP; i want to do this with cursor because this condition happen inside another cursor is it possible to do this with our cursor or declare new cursor inside existing cursor?

1 Answer 1

1

You can/should do it with two cursor and in particular you can nest a second cursor inside the first one.

In particular, give a look to this article about "Neting MySQL Cursor Loops" http://rpbouman.blogspot.it/2005/10/nesting-mysql-cursor-loops.html

It gives you plenty points of view of how you can solve your problem.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.