Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- CREATE OR REPLACE FUNCTION criaTabelaPopulada() RETURNS VOID AS
- $BODY$
- DECLARE
- i INTEGER;
- BEGIN
- i := 1;
- CREATE TABLE empregado(
- id serial, nome varchar(100), matricula integer);
- LOOP
- INSERT INTO empregado (nome, matricula) VALUES ('teste', i);
- EXIT WHEN i > 1000000;
- i :=+1;
- END LOOP;
- END;
- $BODY$
- LANGUAGE plpgsql VOLATILE
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement