|
Search:
Advanced search
|
Browse by category:
|
Glossary | Contact Us |
![]() |
In PSQL, I want to declare a cursor within cursor. The second cursor should use a value from the first cursor in the "where clause". How can I do this? |
||||
Below is an example of how to declare a cursor
within a cursor
.
In this example, we have a cursor called get_tables that retrieves the owner and table_name values. These values are then used in a second cursor called get_columns.
The trick to declaring a cursor within a cursor is that you need to continue to open and close the second cursor each time a new record is retrieved from the first cursor . That way, the second cursor will use the new variable values from the first cursor . |
||||
