Chris Waldmann wrote
In a stored procedure I use two cursors to compare two result set row by row. I want to use the same stored procedure for different tables and alter only the table in the cursor.
Is there a way to alter the tabel name in a cursor? Is there something like cursor variable or cursor reference?
Thomas Steinmaurer answers
Not in an explicit cursor declaration, but you could use the old style for iterating through a result set in combination with EXECUTE STATEMENT.
begin
-- build your sql statement here ...
for execute statement into ... do
begin
end
end