Advertisement
fahadkalil

plpgsql_cursor_implicito

Oct 18th, 2024
108
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PostgreSQL 0.33 KB | Source Code | 0 0
  1. -- Exemplo de bloco anonimo com Cursor Implícito
  2. -- Rodar com a database 'dvdrental'
  3. DO $$
  4. DECLARE
  5.   film_record RECORD;
  6. BEGIN
  7.   FOR film_record IN (
  8.       select title, release_year from film
  9.   )
  10.   LOOP     
  11.     raise notice 'Nome do filme: %', film_record.title;
  12.     raise notice 'Ano: %', film_record.release_year;
  13.   END LOOP;
  14. END; $$
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement