Guest User

Untitled

a guest
Sep 27th, 2016
57
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.49 KB | None | 0 0
  1. CREATE PROCEDURE show @faculty VARCHAR(20)
  2. AS
  3. BEGIN
  4. SELECT * FROM tutor
  5. WHERE title LIKE @faculty+'%'
  6. END
  7.  
  8. The procedure execution:
  9.  
  10. EXEC show 'FI'
  11.  
  12. create table tutor as select 1 as id, 'FI bla bla' as title from dual;
  13.  
  14. create or replace procedure show(prefix varchar2) as
  15. begin
  16. for myrow in (select * from tutor where title like prefix || '%') loop
  17. dbms_output.put_line('row=' || myrow.id || ',' || myrow.title);
  18. end loop;
  19. end show;
  20. /
  21.  
  22. exec show('FI');
  23. row=1,FI bla bla
Add Comment
Please, Sign In to add comment